[CMake] Question about PARENT_SCOPE

Benoit Thomas benoit.thomas at gameloft.com
Mon May 3 14:42:58 EDT 2010


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()

function (foo v)
     bar (${v} PARENT_SCOPE)
endfunction()

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 ?

Thank you,
Ben.



More information about the CMake mailing list