Because "WHATEVER" is not empty... I frequently use: IF("${literal_string}" STREQUAL "")
or: IF(NOT "${literal_string}" STREQUAL "") ...to achieve this goal. It's verbose, but it works and doesn't take too much getting used to. HTH, David On 10/30/07, Brandon Van Every <[EMAIL PROTECTED]> wrote: > > IF("WHATEVER") > MESSAGE("WHATEVER string is true") > ELSE("WHATEVER") > MESSAGE("WHATEVER string is false") > ENDIF("WHATEVER") > > C:\devel\src\cbugs\trueorfalse>cmake -P trueorfalse.cmake > WHATEVER string is false > > I would expect the literal string "WHATEVER" to evaluate to true. By > analogy to IF(variable) as per the docs. The practical application is > I'm trying to sanity check an argument that's a literal string. > > MACRO(DOSOMETHING literal_string result) > IF(${literal_string}) > SET(result "valid") > ELSE(${literal_string}) > MESSAGE(SEND_ERROR "I don't like the input!") > ENDIF(${literal_string}) > ENDMACRO(DOSOMETHING) > DOSOMETHING("WHATEVER" out) > > C:\devel\src\cbugs\trueorfalse>cmake -P trueorfalse.cmake > CMake Error: I don't like the input! > > > Cheers, > Brandon Van Every > _______________________________________________ > CMake mailing list > CMake@cmake.org > http://www.cmake.org/mailman/listinfo/cmake >
_______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake