[CMake] Question about PARENT_SCOPE
Benoit Thomas
benoit.thomas at gameloft.com
Mon May 3 15:34:54 EDT 2010
On 2010-05-03 15:19, Alexander Neundorf wrote:
> On Monday 03 May 2010, Benoit Thomas wrote:
>
>
>> function (foo v)
>> bar (${v} PARENT_SCOPE)
>> endfunction()
>>
> You could have bar() use PARENT_SCOPE to set it in a variable in bar(), which
> could then itself set it to PARENT_SCOPE.
> Would that work ?
>
>
Clinton Stimpson proposed a solution like that, which worked fine. I'm
still trying to make it work correctly in my real project but I think
I'm gonna go with something along those lines.
>> foo (v)
>> message ("${v} == 1")
>>
>> If it's not possible, I'll go with global variables. Currently, I do
>> global variables by doing:
>>
>> set (v 1 CACHE INTERNAL "" FORCE)
>>
>> But is there a better way ?
>>
> You could also set a GLOBAL property, that's more similar to a normal variable
> than a forced CACHE variable.
>
>
I didn't think of this, but will try it, thanks.
--
Ben.
More information about the CMake
mailing list