On Sat, May 22, 2010 at 4:50 AM, Droscy <[email protected]> wrote:
> The right construct is
> IF(ZLIB_FOUND)
> MESSAGE( WARNING "HAVE system zlib" )
> ELSE(ZLIB_FOUND)
> MESSAGE( WARNING "NO system zlib" )
> ENDIF(ZLIB_FOUND)
>
And if compatibility with CMake < 2.4.4 isn't a concern, an even better way
to do this is:
# set this at your topmost CMakeLists.txt
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
if(ZLIB_FOUND)
message("HAVE system zlib")
else()
message("NO system zlib")
endif()
P.S.
The WARNING option to message() is new to CMake 2.8. For
better compatibility with CMake 2.6 and lower, simply omit it which should
give you a similar effect.
--
Philip Lowman
_______________________________________________
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