[CMake] How to pass values up to parent CMakeLists.txt
James Bigler
jamesbigler at gmail.com
Tue Mar 31 22:55:55 EDT 2009
On Mar 31, 2009, at 8:46 PM, Philip Lowman <philip at yhbt.com> wrote:
> On Tue, Mar 31, 2009 at 6:13 PM, James Bigler
> <jamesbigler at gmail.com> wrote:
> I just recently discovered another way to do this. I was troubled
> that pushing it up to the parent scope only pushes it up one level,
> so if you want to push a variable up to the top, you must push it at
> each level in the tree. My discovery was that using the environment
> variable mechanism is a great alternative to a global variable. ;)
>
> Clever. There is also CACHE INTERNAL which is a safer way of doing
> what you're trying to do you might consider trying out. With CACHE
> INTERNAL you can't accidentally trounce environment variables that
> may affect execution of your CMake scripts. It is slightly more
> verbose, however.
>
> set(foo bar CACHE INTERNAL "")
>
> --
> Philip Lowman
That was one of the first things I tried, but there were some issues
with it that I don't quite recall at the moment. Of course that
experiment was a year and a half ago back in the 2.4 days.
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090331/f11caaaa/attachment.htm>
More information about the CMake
mailing list