[CMake] Problem with STREQUAL
William A. Hoffman
billlist at nycap.rr.com
Thu Aug 3 08:52:21 EDT 2006
At 03:59 AM 8/3/2006, Christian Ehrlicher wrote:
>Hi,
>
>One more small problem:
>
>if(NOT WIN32)
> MESSAGE(STATUS "if(NOT WIN32)")
> set(tmp "test")
> if(${tmp} STREQUAL "test")
> MESSAGE(STATUS "match")
> else(${tmp} STREQUAL "test")
> MESSAGE(STATUS "no match")
> endif(${tmp} STREQUAL "test")
>else(NOT WIN32)
> MESSAGE(STATUS "else(NOT WIN32)")
>endif(NOT WIN32)
>
>
>This works fine on non win32, but I get an error:
>
>CMake Error: Error in cmake code at
>C:/tmp/sim-trunk/CMakeLists.txt:6:
>IF had incorrect arguments: ${tmp} STREQUAL "test" (Unknown arguments specified).
>Current CMake stack: C:/tmp/sim-trunk/CMakeLists.txt
>-- no match
Try this:
if("${tmp}" STREQUAL "test")
More information about the CMake
mailing list