[CMake] get_directory_property and get_property

David Cole dlrdave at aol.com
Fri Apr 18 09:14:32 EDT 2014


Hey guys,

Here's an example script that may (or may not!) illuminate things 
somewhat:

    https://gist.github.com/dlrdave/10977804

I think the main point of having VARIABLE in the get_property signature 
is to test whether or not a variable is SET or DEFINED with the uniform 
api of get_property. It may have been added/implemented simply because 
it was easy to do given its implementation.

I agree it's a weird way to set a variable... But it is a nice way to 
test for a variable's set-ness without worrying about the whole 
confusion that arises from using "if" tests with variable names and 
strings in the cmake language. Especially if a variable contains 
another variable's name as its contents...


HTH,
David C.



More information about the CMake mailing list