[CMake] set variable in if block
Juan Sanchez
Juan.Sanchez at amd.com
Mon Jul 30 12:14:46 EDT 2007
Hello,
I am trying to set a variable in an IF block, but it doesn't appear in
the resulting cache or makefile. This is on Linux. Note that when I
run cmake, the ${OSNAME} variable is printed, but the ${FOOBAR} variable
ends up blank.
Thanks,
Juan
IF (${OSNAME} STREQUAL "Linux64")
MESSAGE ("${OSNAME}")
SET (FOOBAR "-m64 -Wall -fPIC -I${PERLLIB} -I${PSTORE}/include")
ENDIF (${OSNAME} STREQUAL "Linux64")
MESSAGE ( "COMPILE_FLAGS ${FOOBAR}")
More information about the CMake
mailing list