Re: [CMake] Functions inherit parent variables?

2012-03-07 Thread Johannes Zarl
Drifting away from the original thread topic... On Tuesday 06 March 2012, 08:09:27, Michael Hertling wrote: IMO, the documentation of the PARENT_SCOPE flag is sufficiently clear: If PARENT_SCOPE is present, the variable will be set in the scope *above* the current scope. Each new directory

Re: [CMake] Functions inherit parent variables?

2012-03-05 Thread Johannes Zarl
On Saturday 03 March 2012, 02:29:05, Robert Dailey wrote: Well you're really comparing apples to oranges. C++ nested scoping rules really have nothing to do with two separate functions sharing scoped variables. It doesn't even really serve as a good analogy, so I can't be 100% certain what you

Re: [CMake] Functions inherit parent variables?

2012-03-05 Thread Michael Hertling
On 03/05/2012 10:43 AM, Johannes Zarl wrote: On Saturday 03 March 2012, 02:29:05, Robert Dailey wrote: Well you're really comparing apples to oranges. C++ nested scoping rules really have nothing to do with two separate functions sharing scoped variables. It doesn't even really serve as a good

Re: [CMake] Functions inherit parent variables?

2012-03-02 Thread Michael Hertling
On 03/01/2012 06:01 PM, Robert Dailey wrote: No, the print statement is not missing. In fact it prints just fine (function test() is able to obtain the value for variable SOME_TEST). I meant the output SOME_TEST: HELLO WORLD was missing in your report. This isn't exactly the same as C++. In

Re: [CMake] Functions inherit parent variables?

2012-03-02 Thread Robert Dailey
Well you're really comparing apples to oranges. C++ nested scoping rules really have nothing to do with two separate functions sharing scoped variables. It doesn't even really serve as a good analogy, so I can't be 100% certain what you were trying to tell me ;-) However I appreciate your

Re: [CMake] Functions inherit parent variables?

2012-03-02 Thread Michael Hertling
On 03/03/2012 02:29 AM, Robert Dailey wrote: Well you're really comparing apples to oranges. C++ nested scoping rules really have nothing to do with two separate functions sharing scoped variables. It doesn't even really serve as a good analogy, so I can't be 100% certain what you were trying

Re: [CMake] Functions inherit parent variables?

2012-03-01 Thread Robert Dailey
No, the print statement is not missing. In fact it prints just fine (function test() is able to obtain the value for variable SOME_TEST). This isn't exactly the same as C++. In C++, a function does not have access to the calling function's local declarations. In order for the function to get

[CMake] Functions inherit parent variables?

2012-02-29 Thread Robert Dailey
I ran a quick test: function( test ) message( SOME_TEST: ${SOME_TEST} ) endfunction() function( start ) set( SOME_TEST HELLO WORLD ) test() endfunction() start() Seems like a function has access to the calling scope's defined variables. I thought because functions created a new scope, that

Re: [CMake] Functions inherit parent variables?

2012-02-29 Thread Michael Hertling
On 03/01/2012 01:38 AM, Robert Dailey wrote: I ran a quick test: function( test ) message( SOME_TEST: ${SOME_TEST} ) endfunction() function( start ) set( SOME_TEST HELLO WORLD ) test() endfunction() start() Seems like a function has access to the calling scope's defined