The CMakeLists.txt adds -std=c++11 and related compiler flags, but looses default flags specified by CMake build type.
For example, -DCMAKE_BUILD_TYPE=Debug has no effect, as -g flag gets lost.
By adding headers to sources of targets, CMake adds them to list of project files generated for IDEs.
This is non-intrusive trick, which does not affect targets compilation.