summaryrefslogtreecommitdiffstats
path: root/Modules/FindZLIB.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2006-06-09 19:49:27 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2006-06-09 19:49:27 (GMT)
commit97c532453412cf2ab0d375ef975ccc8be0131377 (patch)
treeadc523c4092473cba65ca9c41d12f0248a9ae908 /Modules/FindZLIB.cmake
parentbba61bc8a7a7f399a5c9d18172160d424bbc9f7d (diff)
downloadCMake-97c532453412cf2ab0d375ef975ccc8be0131377.zip
CMake-97c532453412cf2ab0d375ef975ccc8be0131377.tar.gz
CMake-97c532453412cf2ab0d375ef975ccc8be0131377.tar.bz2
BUG: don't append to ZLIB_NAMES
ENH: also check for zdll on windows ENH: honor REQUIRED and QUIETLY Alex
Diffstat (limited to 'Modules/FindZLIB.cmake')
-rw-r--r--Modules/FindZLIB.cmake38
1 files changed, 28 insertions, 10 deletions
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index e648817..b2a1a66 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -5,23 +5,41 @@
# ZLIB_LIBRARIES - List of libraries when using zlib.
# ZLIB_FOUND - True if zlib found.
+
+IF (ZLIB_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(ZLIB_FIND_QUIETLY TRUE)
+ENDIF (ZLIB_INCLUDE_DIR)
+
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
/usr/local/include
/usr/include
)
-SET(ZLIB_NAMES ${ZLIB_NAMES} z zlib)
-FIND_LIBRARY(ZLIB_LIBRARY
- NAMES ${ZLIB_NAMES}
- PATHS /usr/lib /usr/local/lib
+SET(ZLIB_NAMES z zlib zdll)
+FIND_LIBRARY(ZLIB_LIBRARY
+ NAMES ${ZLIB_NAMES}
+ PATHS /usr/lib /usr/local/lib
)
-IF(ZLIB_INCLUDE_DIR)
- IF(ZLIB_LIBRARY)
- SET( ZLIB_LIBRARIES ${ZLIB_LIBRARY} )
- SET( ZLIB_FOUND "YES" )
- ENDIF(ZLIB_LIBRARY)
-ENDIF(ZLIB_INCLUDE_DIR)
+IF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
+ SET(ZLIB_FOUND TRUE)
+ SET( ZLIB_LIBRARIES ${ZLIB_LIBRARY} )
+ELSE (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
+ SET(ZLIB_FOUND FALSE)
+ SET( ZLIB_LIBRARIES )
+ENDIF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
+
+IF (ZLIB_FOUND)
+ IF (NOT ZLIB_FIND_QUIETLY)
+ MESSAGE(STATUS "Found ZLIB: ${ZLIB_LIBRARY}")
+ ENDIF (NOT ZLIB_FIND_QUIETLY)
+ELSE (ZLIB_FOUND)
+ IF (ZLIB_FIND_REQUIRED)
+ MESSAGE(STATUS "Looked for Z libraries named ${ZLIBS_NAMES}.")
+ MESSAGE(FATAL_ERROR "Could NOT find z library")
+ ENDIF (ZLIB_FIND_REQUIRED)
+ENDIF (ZLIB_FOUND)
MARK_AS_ADVANCED(
ZLIB_LIBRARY