Hi Torsten

Torsten Rohlfing ha scritto:
> IF(ZLIB_FOUND)
>   MESSAGE( WARNING "HAVE system zlib" )
> ELSEIF(ZLIB_FOUND)
>   MESSAGE( WARNING "NO system zlib" )
> ENDIF(ZLIB_FOUND)
>
> [...]
>
> Can someone explain to me what I am missing?
You are not missing anything, simply you are wrongly using the IF
construct because the second command should be ELSE, not ELSEIF.

Your construct can be interpreted like this one
IF(ZLIB_FOUND)
    MESSAGE( WARNING "HAVE system zlib" )
ELSE(ZLIB_FOUND)
    IF(ZLIB_FOUND)
        MESSAGE( WARNING "NO system zlib" )
    ENDIF(ZLIB_FOUND)
ENDIF(ZLIB_FOUND)
so, of course you get no output if zlib is not found, and two outputs if
zlib is found.

The right construct is
IF(ZLIB_FOUND)
    MESSAGE( WARNING "HAVE system zlib" )
ELSE(ZLIB_FOUND)
    MESSAGE( WARNING "NO system zlib" )
ENDIF(ZLIB_FOUND)


Bye
Droscy


_______________________________________________
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

Reply via email to