[CMake] How to use generated cmake files?

Tyler Roscoe tyler at cryptio.net
Mon Mar 9 13:43:21 EDT 2009


On Mon, Mar 09, 2009 at 06:33:19PM +0100, Stephan Springer wrote:
>     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.

You want a custom_command (and probably a custom_target). Check out the
pattern for how to use these here:

http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_generate_an_executable.2C_then_use_the_executable_to_generate_a_file.3F

and in the next couple of FAQ entries.

tyler


More information about the CMake mailing list