[CMake] Problem with design and ADD_SUBDIRECTORY
Hendrik Sattler
post at hendrik-sattler.de
Wed Jul 15 05:47:38 EDT 2009
Zitat von Martin Santa Maria <martin_san03 at hotmail.com>:
> Thanks to all for your answers.
>
> The thing is that I don't want to code statically the existence of packages
> in the root/CMakeLists.txt but I want that each package register it-self in
> some "package container" that the CMakeLists.txt could read. This container
> should be seen as a set of lists and variables that contains, for example,
> the source files or some flags. I was having problem with ADD_SUBDIRECTORY
> because the only way I found to pass the information from package's
> CMakeLists.txt files to the root's CMakeLists.txt was using cache variables
> but this doesn't work completely because the variables are not reinitialized
> on each configure and I had an growing list of things.
>
> I think I will success with PARENT_SCOPE flag and some macros. I tell you
> soon. Regards
That's the way to push variables. You can also pull them via directory
properties:
http://www.cmake.org/cmake/help/cmake2.6docs.html#prop_dir:VARIABLES
HS
More information about the CMake
mailing list