[CMake] How to create SOURCE_GROUP for include files

Steve Johns steve.johns at verizon.net
Fri Jul 7 12:26:52 EDT 2006


>> SOURCE_FILES( "Include Files" FILES  afile.hpp bfile.hpp )

> This just assigns a group to the source files, but they still have to be 
> explicitly added to the source list of a target.

So, with a source dir tree like this:

ProjDir
    src
    incl
    lib


into which directory's CMakelists.txt file should I put the

    SOURCE_FILES( "Include Files" FILES  x.hpp y.hpp )

command, and could this:

    ADD_LIBRARY( MyLibProj x.cpp y.cpp x.hpp y.hpp )

then be what is intended by "add to the source list of a target", (which is 
a library, in this case)?

I've not needed to name .hpp files in ADD_LIBRARY() commands so far (?), and 
my experiments are still failing.

If possible, I think I need either a little further explanation, or a 
pointer to a working example.  (Thanks!)










More information about the CMake mailing list