On 15 August 2011 20:23, Albert Meltzer <[email protected]> wrote:
> Maybe the esteemed colleagues would suggest another good and reliable way
> to handle situations such as this:
>
> IF (lang STREQUAL "perl") ...
> ELSEIF(lang STREQUAL "python") ...
> ELSEIF(....)
> ...
> ENDIF ()
>
> without having to SET(perl perl) (and all the other cases in this switch)
> myself (just in case), but still being afraid that somebody, somewhere else,
> would SET(perl 5.10.0), and without resorting to IF (lang MATCHES "^perl$")?
>
Maybe I'm missing something obvious here but wouldn't the following code
work okay:
if ("${lang}" STREQUAL "perl") ...
elseif ("${lang}" STREQUAL "python") ...
elseif (....)
...
endif ()
--
Glenn
_______________________________________________
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