[CMake] How to use generated cmake files?

Stephan Springer List.CMake at Lini.de
Mon Mar 9 13:33:19 EDT 2009


Hi,

    I'd like to compile a lot of generated C++ source files which are all
generated at once with a single command.  Since there are issues with
using file( GLOB_RECURSE ...) to get a list of these generated files, I
tried to additionally generate a file called "sourcelist.cmake" which
contains a list( APPEND ...) command with a list of all generated files.

    Now I include() this file from my CMakeLists.txt and it works as expected
- as long as that sourcelist.cmake file is already there.  If it's not,
I'm getting an error "include could not find load file".

    How could I set up a dependency which starts my generator in case this
include file is not there yet?  I've tried a few things, looked at the FAQ
and googled a bit, but couldn't find anything.  I'm using CMake 2.6.2 on
Linux.

Thanks,

    - Stephan.



More information about the CMake mailing list