[CMake] Inherited Directory Properties?

Mateusz Loskot mateusz at loskot.net
Fri Sep 13 17:48:07 EDT 2013


On 13 September 2013 22:42, Stewart, Robert <Robert.Stewart at sig.com> wrote:
> Matthew Woehlke wrote:
>> On 2013-09-13 16:43, Stewart, Robert wrote:
>> > I want a way to manage a list that applies to the current
>> > directory and any subdirectories, unless overridden for a
>> > subdirectory (which then applies to that subdirectory's
>> > subdirectories).
>> >
>> > I tried using SET_DIRECTORY_PROPERTIES() to set/modify the
>> > list, for the current directory, but GET_DIRECTORY_PROPERTY()
>> > doesn't find that list when in a subdirectory (unless I've
>> > made some mistake, of course).
>> >
>> > Is there a way to do what I want?
>>
>> What's wrong with a regular variable?
>
> Ah, I forgot to mention that.  I'm using FUNCTION(), rather than
> MACRO(), for the function that sets the value.  That means the
> value doesn't escape to the caller.  What's worse, is that
> function can be called by yet another function, so even using
> PARENT_SCOPE isn't enough.
>
> The values I'm setting should be accessible throughout the build
> without any need to know the list's name or ensure it's
> definition reaches the scope at the top of the call stack.

Robert,

Am I getting it right, that you are trying to set a custom
user-defined property with set_directory_properties (or set_property),
like here:

set_directory_properties(PROPERTIES MY_PROP "foo")

You don't mean the "CMake, cache or environment variable"
set with the command "set" by any chance?

Best regards,
-- 
Mateusz  Loskot, http://mateusz.loskot.net
"Participation in this whole process is a form of torture" ~~ Szalony


More information about the CMake mailing list