Hi all, I am running cmake version 2.6-patch 2. I stumbled over the following, and I think it is a bug.
If I run cmake on this CMakeLists.txt: cmake_minimum_required(VERSION 2.6) set(options fine good bad) #option(fine "Fine" OFF) #option(good "Good" OFF) option(bad "Bad" OFF) foreach(opt ${options}) message(STATUS "opt = ${opt}") if(${opt} STREQUAL fine) message(STATUS "This is fine") elseif(${opt} STREQUAL good) message(STATUS "This is good") else(${opt} STREQUAL fine) message(FATAL_ERROR "This is bad!") endif(${opt} STREQUAL fine) endforeach(opt ${options}) I get the following output: ... -- val = fine -- fine -- val = good -- good -- val = bad CMake Error at CMakeLists.txt:14 (message): bad ... which is to be expected. However, when I uncomment the line option(fine...), I get the following output: ... -- opt = fine -- This is fine -- opt = good -- This is good -- opt = bad -- This is fine -- Configuring done ... which is clearly wrong! Uncommenting the line option(good...) yields almost the same output, but now the elseif branch is followed. Is this a bug, or am I overlooking something? Best regards, Marcel Loose. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake