On Monday 03 May 2010, Benoit Thomas wrote:
> Hello,
>
> Is it possible to do something like this (sorry if there are typos):
>
> function (bar v scope)
> set (v 1 GRAND_PARENT_SCOPE)
> endfunction()
No :-)
> 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 ?
> 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.
Alex
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake