What page in the book...? Try "LESS" instead of "less" (note the capital letters)
CMake is only semi-case-insensitive -- it used to be all uppercase all the time. Lots of folks didn't like it, so the CMake guys made the CMake *commands* work regardless of case, but some command args (like LESS for the IF command) are still case sensitive. CMake variable names are also case sensitive... And ask qeuestions on the mailing list. Even if they seem silly. That way everybody can benefit from the discussion. If you have the question, somebody else will be wondering that same thing... Good luck, Dave On 4/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
The following example taken from the book generates errors. I suspect the error is caused by the fact that the value of foo is changed before the else statement is evaluated. Am I correct or is something else going on? Thanks, Dave set (foo 1) IF (${foo} less 2) set (foo 2) ELSE (${foo} less 2) set (foo 3) ENDIF (${foo} less 2) CMake Error: Error in cmake code at /home/daf/CmTest/CMakeLists.txt:4: IF had incorrect arguments: ${foo} less 2 (Unknown arguments specified). Current CMake stack: /home/daf/CmTest/CMakeLists.txt;/usr/local/share/CMake/Modules/CMakeCInformation.cmake;/usr/local/share/CMake/Modules/CMakeCXXInformation.cmake CMake Error: Error in cmake code at /home/daf/CmTest/CMakeLists.txt:6: ELSE An ELSE command was found outside of a proper IF ENDIF structure. Or its arguments did not match the opening IF command. Current CMake stack: /home/daf/CmTest/CMakeLists.txt;/usr/local/share/CMake/Modules/CMakeCInformation.cmake;/usr/local/share/CMake/Modules/CMakeCXXInformation.cmake
_______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake