[CMake] unset(PARENT_SCOPE)

Matthew Woehlke matthew.woehlke at kitware.com
Tue Sep 17 15:31:35 EDT 2013


On 2013-09-17 14:00, James Bigler wrote:
> If there is a set(PARENT_SCOPE) why isn't there an unset(PARENT_SCOPE)?  It
> seems like a hole in the API.
>
> I noticed this when I was trying to update my push_variable/pop_variable
> functions.  I use set(PARENT_SCOPE) to set the variable outside of the
> function, but when doing pop_variable I want to use unset(PARENT_SCOPE) if
> the variable was undefined before push_variable.

ISTR that 'set(name PARENT_SCOPE)' does what you want?

I suppose having a PARENT_SCOPE to unset() could make sense, but I think 
you can do what you want without it.

-- 
Matthew



More information about the CMake mailing list