Regarding the cmake-commands manual , the "option" command seems to take as
argument a boolean constant that can have the two possible values: ON or OFF.
I would like to use three possible values for an option: AUTO (as default
value), ON or OFF.
option(ENABLE_SOMETHING "Enable SOMETHING support" AUTO)
But of course this example is wrong because "AUTO" is not ON or OFF.
Regarding the cmake-commands manual , the "if" command seems to return TRUE
when the boolean constant is 1, ON, YES, TRUE, Y, or a non-zero number.
It returns FALSE when the boolean constant is 0, OFF, NO, FALSE, N, IGNORE,
NOTFOUND, the empty string, or ends in the suffix -NOTFOUND.
I would like to check the value myself.
But of course this example is wrong because "=" is not accepted for an
expression in a "if" command.
So my question is: How to handle options with more than two possible values?
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
Follow this link to subscribe/unsubscribe: