[CMake] How to make FILE() append to the list of files?

Alexander Neundorf a.neundorf-work at gmx.net
Fri Nov 28 16:50:15 EST 2008


On Friday 28 November 2008, you wrote:
> On Nov 28, 2008, at 12:09 AM, Robert Dailey wrote:
...
> > Okay, so if I hard-code the list of files to compile, I still need
> > to create 1 CMakeLists.txt file for each of the 20 directories
> > containing CPP files to compile. However, this is simply to
> > modularize the CMake script itself. I suppose I could use include()
> > instead of add_subdirectory()?
> > _______________________________________________
> > CMake mailing list
> > CMake at cmake.org
> > http://www.cmake.org/mailman/listinfo/cmake
>
> Yes, Include would be the better command to use if the cmake file is
> just a list of files.

You could also just list all files in the top level CMakeLists.txt if you want 
to:
set(mySrcs foo.c bar.c
           sub1/blub.c 
           sub2/gnaz.c
           ...)

Alex


More information about the CMake mailing list