[Cmake] Setting variables breaks the cache for SUBDIRS?

William A. Hoffman billlist at nycap.rr.com
Wed, 14 Apr 2004 14:19:20 -0400


OK, so you have hit on the reason, sometimes subdirs are processed
in a completely different process.   When cmake does a make depend step,
it re-runs cmake in a local directory.   There has been some talk about removing
the local generate step, and perhaps it would clear up some of these issues.

Another solution for your current problem might be an INCLUDE command which
can be used to set variables.

Something like this:
INCLUDE(foo/variables.cmake)
SUBDIR(foo)


-Bill

 
At 01:57 PM 4/14/2004, Zachary Pincus wrote:

>Confusion (2): how the environment for the SUBDIRS() is set up. I would never have guesses that the top-level CMakeList is basically re-run for each subdir. This is un-documented, and even runs a bit counter in spirit if not in specific assertion to the statement that all CMakeLists are run in the same process and that the environment is "inherited." As it stands, the subdirs CMakeLists might as well run in different processes, and the "re-created" is more appropriate than "inherited."