[CMake] Generating Source Files
Jeremy Cowgar
jeremy at cowgar.com
Wed Apr 8 13:13:16 EDT 2009
Bill Hoffman wrote:
> One more option would be to run the parser every time cmake is run.
> If you had an option to the parser that just spit out the list of
> files you needed to compile, and it ran relatively fast, you could do
> this:
>
> # only run if parser.e is newer than source.cmake
> if(parser.e IS_NEWER_THAN source.cmake)
> execute_process(COMMAND myparser parser.e --sources sources.cmake)
> endif()
I like this solution much better, but I have simplified things for my
example. I have been stating parser.e is the only input file. While that
is true, parser.e is known to depend on a set of other files. So, in the
above example I would need to check IS_NEWER_THAN a list of files I have:
SET( EU_CORE_FILES common.e emit.e error.e fwdref.e global.e inline.e
keylist.e main.e mode.e opnames.e parser.e
pathopen.e reswords.e scanner.e scinot.e shift.e symtab.e )
Is there a simple way of doing that?
Jeremy
More information about the CMake
mailing list