[CMake] CMake 2.8.1 / Win: Neither if nor else?`

Torsten Rohlfing torsten at synapse.sri.com
Fri May 21 17:04:38 EDT 2010


Hi --

At the risk of asking a stupid question: I seem to have a situation 
where CMake (2.8.1 on Windows XP) completely ignore an IF .. ELSE .. 
ENDIF construct and basically does neither the IF nor the ELSE branch.

My CMakeLists.txt is as follows:

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

FIND_PACKAGE(ZLIB)
IF(ZLIB_FOUND)
   MESSAGE( WARNING "HAVE system zlib" )
ELSEIF(ZLIB_FOUND)
   MESSAGE( WARNING "NO system zlib" )
ENDIF(ZLIB_FOUND)

Now I would think that I should see wither the "HAVE" or the "NO" 
message in the config stage output, on Windows more likely the "NO" 
message of course.

Instead, what I get is this:

Check for working C compiler using: Visual Studio 10
Check for working C compiler using: Visual Studio 10 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 10
Check for working CXX compiler using: Visual Studio 10 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Could NOT find ZLIB  (missing:  ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS)
Configuring done

Can someone explain to me what I am missing?

Thanks!
   Torsten

-- 
Torsten Rohlfing, PhD          SRI International, Neuroscience Program
  Senior Research Scientist      333 Ravenswood Ave, Menlo Park, CA 94025
   Phone: ++1 (650) 859-3379      Fax: ++1 (650) 859-2743
    torsten at synapse.sri.com        http://www.stanford.edu/~rohlfing/

      "Though this be madness, yet there is a method in't"



More information about the CMake mailing list