[CMake] Getting variables from a subdir

Ken Martin ken.martin at kitware.com
Tue Sep 13 11:02:28 EDT 2005


I have added a new feature to help folks get variables from a subdir. I have
modified the GET_DIRECTORY_PROPERTY command to have an optional argument
that is the directory to get the property from. I also added the ability to
query variables from the GET_DIRECTORY_PROPERTY command. So you can now do:


add_subdirectory( foo )

get_directory_property( bar DIRECTORY foo DEFINITION var_name)


You can also get all the other directory properties that
get_directory_property supports from foo as well if you want. Note that if
you swap the order of the two lines above it will not work. You cannot get a
property from a subdir before the subdir is processed. (sort of obvious but
worth being clear on)

Thanks
Ken




More information about the CMake mailing list