[CMake] adding dependencies on all targets to force CMake to rerun itself

Philip Lowman philip at yhbt.com
Wed Oct 10 22:20:04 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alan W. Irwin wrote:
> On 2007-10-10 12:40-0400 Philip Lowman wrote:
>> Basically I have something like this but I want all targets in the build
>> to depend on changes to foo.txt so that CMake runs itself again.
>>
>> MACRO(Foo)
>>     FILE(READ ${PROJECT_SOURCE_DIR}/foo.txt contents)
>>     ... define variables for include path, directory recursion,
>>            etc., that get used later
>> ENDMACRO(Foo)
> 
> It appears you are
> reading the file to "define variables for include path, directory
> recursion,
> etc., that get used later".  Why not simply do that task using CMake
> instructions that are INCLUDEd from a file?
> 
> For example,
> 
> SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
> INCLUDE (plplot)

Actually that's probably not a bad idea now.  Originally I had devised
the CMake macro to read a custom file because that's how developers were
used to defining all of the libraries and their allowable include paths
and I didn't want to change existing behavior.  Now that everyone's
bought into CMake perhaps this is a moot point now. :)

- --
Philip Lowman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHDYhUe0tOktX6RKkRAiDZAJ9l9opBgL/E+R0FP8iktEh1m0UPkQCfbRF6
fCVhSIApMCrB7OoTTkKuuxI=
=ahoA
-----END PGP SIGNATURE-----


More information about the CMake mailing list