I was trying to test some different ways to add headers to a project (add_custom_target, source_group, etc.). To start to test this, I created a folder with my CMakeLists.txt:

Qt Code:
  1. Project(TestProject)
  2. add_executable(Test Test.cpp)
To copy to clipboard, switch view to plain text mode 

and two other files, Test.cpp and Test.h. When I opened the CMakeLists.txt file with QtCreator and generated the project, I was suprised to find Test.h was added to the project. I created another header file, MyClass.h, and re-ran CMake and this file was not added to the project (as I originally expected).

Is it the desired behavior for files with the same prefix to be added to the project? Or is there some other explanation of why Test.h would be added to the project without being mentioned in the CMakeLists.txt?

Thanks,

David