[CMake] Reading settings from generated files

Andrea Gualano gualano at imavis.com
Mon May 12 09:48:24 EDT 2008


I am cross-compiling for an embedded platform and I have to use a 
third-party tool which, depending on a per-project configuration file, 
does the following:
- compiles a .o file with some init code
- generates a file containing a list of libraries to link against
- generates a file containing some compiler flags

I am quite happy to do this with ADD_CUSTOM_COMMAND, since the operation 
is quite slow so I'd like to do that on make time, and also because the 
third-party tool is automatically rerun if the configuration file changes.

Now, the question is: how do I read the generated files to set things 
like CMAKE_C_FLAGS and LINK_DIRECTORIES after the custom command is 
executed?
I could find no way to manipulate files after configuration time.

Best regards,
Andrea




More information about the CMake mailing list