I have just started using QtCreator. When I open a CMake project in QtCreator, all of my cpp files mentioned in the CMakeLists.txt are added to the "project". However, my headers (.h) and template implementation (.hpp) are not added to the project (I believe this is the same behavior as Visual Studio). I have seen this thread: <a href="http://www.cmake.org/pipermail/cmake/2003-January/003274.html" target="_blank">http://www.cmake.org/pipermail/cmake/2003-January/003274.html</a> that says you can simply add the headers to the add_executable/add_library line:<br>
<br>add_library(MyProject main.cpp MyClass.h MyClass.cpp)<br><br>This works fine. However, I have several projects that are "template only" (there are no .cpp files), and I essentially only use them as git submodules, so there are actually no driver cpp files either (the drivers are in the project that includes the submodule). That is, the complete directory looks like this:<div>
<br></div><div>MyProject/CMakeLists.txt</div><div>MyProject/MyProject.h</div><div><br></div><div>Because of this, I can't use add_executable or add_library at all. Is there another command that can get CMake to add these files to the project?</div>
<div><br></div><div>Thanks,</div><div><br>David</div>