[cmake-developers] Adding source files not built by targets to CMake project

Nils Gladitz nilsgladitz at gmail.com
Fri Nov 20 10:46:52 EST 2015


On 11/20/2015 04:43 PM, Marcus D. Hanwell wrote:
> I would like to see these files listed in Qt Creator (or insert your
> IDE of choice here). Is there anyway to do this, knowing that these
> files are not going to be built for a target (or compiled in any way).
> Any trick I am missing to make this work? When I include a .cmake file
> I see it is added, so I feel like there is some plumbing already in
> place to feed through these source files that are not built by
> targets.

If they are related to an existing build target 
(add_executable()/add_library()) you can list them there with your 
regular sources.
Otherwise e.g. add_custom_target(my_custom_target SOURCES foo.py 
bar.json ...) should work.

Nils


More information about the cmake-developers mailing list