MantisBT - CMake
View Issue Details
0002221CMakeCMakepublic2005-09-09 17:262005-09-15 13:55
Klaas Holwerda 
Ken Martin 
lowfeaturealways
closedfixed 
 
 
0002221: ADD_SUBDIRECTORY export variables
ADD_SUBDIRECTORY(foo EXPORT_VARIABLES FOO_VAR1 FOO_VAR2)

The ADD_SUBDIRECTORY command would evaluate the subdirectory configuration and then set the variables FOO_VAR1 and FOO_VAR2 to their subdirectory values in the current directory. This would allow subdirectories to continue to work in isolation but the parent directory would have the option of getting information it wants. Since the variables are explicitly listed then it will be clear when/how these variables are set just from reading the CMake code in a directory and its parents without exploring all children.
No tags attached.
Issue History

Notes
(0003028)
Ken Martin   
2005-09-15 13:55   
This capability (and a bit more) has been added by extending the GET_DIRECTORY_PROPERTY command. This approach also has the benefit of being able to get variables from directories that are not immediate subdirectories without having to modify the intermediate directory's CMakeLists file.