[CMake] passing by reference to a MACRO

Jesse Corrington jesse.corrington at gmail.com
Wed Jul 16 16:09:10 EDT 2008


Is there anyway to have variables passed by reference to a macro so the
original will be updated. I'm pretty sure the answer is no, but maybe I just
don't know the syntax well enough. Here is what I'm trying to do:

MACRO( TEST_SET variable, value )
    SET( variable ${value} )
ENDMACRO()


SET( TEST_VAR "testvar" )
TEST_SET( TEST_VAR "newval" )
MESSAGE( SEND_ERROR ${TEST_VAR} )

prints out "testvar", but I want it to be "newval"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080716/a64ecb3f/attachment-0001.htm>


More information about the CMake mailing list