C++ CMake (add non-built files)

c++, cmake

Solution

You should be able to just add them to your list of sources in whichever `add_executable` or `add_library` call is appropriate and they will appear in the IDE.

I believe CMake uses the files' extensions to determine if they are actual source files, so if yours have extensions like ".txt" or ".log" they won't be compiled.

Problem

I am using cmake to configure my project. I visualize project's files using qtcreator which read the CMakeLists.txt. I have a few text files (non-code: config files, log, ..) and I would like to add them to my cmake project without (of course) compiling/linking them. Is it possible ? The main goal it to open them automatically in the tree of my project with qtcreator and edit them ... Thanks for help.

Original source