[CMake] CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS available in version X?

Philip Lowman philip at yhbt.com
Thu Dec 6 00:51:20 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

James Bigler wrote:
> On Nov 27, 2007, at 3:14 PM, Filipe Sousa wrote:
> 
>> James Bigler wrote:
>>> I just noticed this Wiki entry.  What version of CMake was this
>>> introduced in?  It's not mentioned in any of the help files, so I
>>> can't track when it was introduced.
>>>
>>> http://www.cmake.org/Wiki/CMake_FAQ#Isn.27t_the_.22Expression.
>>> 22_in_the_.22ELSE_.28Expression.29.22_confusing.3F
>>>
>>> SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
>>
>> 2.4.3
> 
> Thanks for the response!

I realize this is an old thread, but mad props to the developer who
added this feature.  Ever since ELSEIF was introduced I've seen this
feature become somewhat of a necessity in improving readability and
maintainability of my control flow.

Seeing this:

IF(foo AND long_conditional_that_I_dont_want_to_type_3_times)
   MESSAGE("go foo")
ELSEIF(bar)
   MESSAGE("go bar")
ELSE(foo AND long_conditional_that_I_dont_want_to_type_3_times)
   MESSAGE("ERROR")
ENDIF(foo AND long_conditional_that_I_dont_want_to_type_3_times)

Turn into this, is wicked cool.

IF(foo AND long_conditional_that_I_dont_want_to_type_3_times)
   MESSAGE("go foo")
ELSEIF(bar)
   MESSAGE("go bar")
ELSE()
   MESSAGE("ERROR")
ENDIF()


- --
Philip Lowman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHV43Ye0tOktX6RKkRAmY9AKCOxLfGRDIWG7dynGjz23MvzfTiwwCgiat4
t7J1O0xQ05+AlxnnSJDDey0=
=lKS8
-----END PGP SIGNATURE-----


More information about the CMake mailing list