Am Donnerstag, den 12.05.2011, 17:10 +0200 schrieb Michael Wild:
> I agree, that this behaviour is due the fact that the parameter name
> "var" hides the parent-scope variable "var", but then ${${var}} should
> IMHO result in an error or warning message. Essentially, what this does
> inside the fun
I agree, that this behaviour is due the fact that the parameter name
"var" hides the parent-scope variable "var", but then ${${var}} should
IMHO result in an error or warning message. Essentially, what this does
inside the function is
set(var var)
which is hardly ever what is intended. This could
If you really wanted to pass the name of the variable in rather than the
value, then as Rolf says the behaviour you get is as expected. The only way
round that would be to rename var in the function to something guaranteed
not to be the name of a variable that you ever tried to pass in.
Or you co
Am Donnerstag, den 12.05.2011, 11:50 +0100 schrieb Glenn Coombs:
> I think you probably wanted to write and call your function like this:
>
> FUNCTION(build var)
>MESSAGE(STATUS "var: ${var}")
> ENDFUNCTION(build)
>
> SET(var red blue yellow green)
> build("${var}")
>
> That prints out a
Often one wants to pass in the *name* of a variable (i.e. the name of
list, like for list(APPEND name ...)), so Rolf's code does make sense.
Haven't had the time to try the test-case myself, though...
Michael
On 05/12/2011 12:50 PM, Glenn Coombs wrote:
> I think you probably wanted to write and c
I think you probably wanted to write and call your function like this:
FUNCTION(build var)
MESSAGE(STATUS "var: ${var}")
ENDFUNCTION(build)
SET(var red blue yellow green)
build("${var}")
That prints out as you would expect:
-- var: red;blue;yellow;green
--
Glenn
On 12 May 2011 07:27,
> This is funny:
> FUNCTION(build var)
> MESSAGE(STATUS "var: " ${${var}})
> ENDFUNCTION(build)
>
> SET(var red blue yellow green)
> build(var)
>
> Output:
> -- var: var
>
> SET(varX red blue yellow green)
> build(varX)
> Output:
> -- var: redblueyellowgreen
No, it must be that way. Inside b
This is funny:
FUNCTION(build var)
MESSAGE(STATUS "var: " ${${var}})
ENDFUNCTION(build)
SET(var red blue yellow green)
build(var)
Output:
-- var: var
SET(varX red blue yellow green)
build(varX)
Output:
-- var: redblueyellowgreen
Greetings
Micha
Tyler Roscoe wrote:
On Wed, Mar 11, 2009 at 09:39:30AM +0200, lari...@gmail.com wrote:
How can i specify the following parameters in my CMakeLists.txt?
cmake -DCMAKE_THREAD_LIBS:STRING="-pthread" -DCMAKE_USE_PTHREADS:BOOL=ON
-DCMAKE_EXE_LINKER_FLAGS:STRING="-pthread"
Maybe I don't un
On Wed, Mar 11, 2009 at 09:39:30AM +0200, lari...@gmail.com wrote:
> How can i specify the following parameters in my CMakeLists.txt?
> cmake -DCMAKE_THREAD_LIBS:STRING="-pthread" -DCMAKE_USE_PTHREADS:BOOL=ON
> -DCMAKE_EXE_LINKER_FLAGS:STRING="-pthread"
Maybe I don't understand the question but
How can i specify the following parameters in my CMakeLists.txt?
cmake -DCMAKE_THREAD_LIBS:STRING="-pthread" -DCMAKE_USE_PTHREADS:BOOL=ON
-DCMAKE_EXE_LINKER_FLAGS:STRING="-pthread"
P.S. Sorry for my English:)
___
Powered by www.kitware.com
Visit oth
11 matches
Mail list logo