summaryrefslogtreecommitdiffstats
path: root/Modules/FindZLIB.cmake
diff options
context:
space:
mode:
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2010-04-17 07:13:37 (GMT)
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2010-04-17 07:56:00 (GMT)
commit5abed16cc23501c35fd679a87905c04ffd9ae6c4 (patch)
tree659cbf2ebfa22a0cc8755999f5e0de8d73c5d90c /Modules/FindZLIB.cmake
parent7c9e72ad235a550673421a004eeea775320c36a2 (diff)
downloadCMake-5abed16cc23501c35fd679a87905c04ffd9ae6c4.zip
CMake-5abed16cc23501c35fd679a87905c04ffd9ae6c4.tar.gz
CMake-5abed16cc23501c35fd679a87905c04ffd9ae6c4.tar.bz2
FindZLIB: only set INCLUDE_DIRECTORIES/LIBRARIES if zlib is found
Diffstat (limited to 'Modules/FindZLIB.cmake')
-rw-r--r--Modules/FindZLIB.cmake11
1 files changed, 6 insertions, 5 deletions
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index 1dac67a..499ae77 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -41,12 +41,13 @@ IF (ZLIB_INCLUDE_DIR)
STRING(REGEX REPLACE ".*#define ZLIB_VERSION \"([0-9]+)\\.([0-9]+)\\.([0-9]+)\".*" "\\1.\\2.\\3" ZLIB_VERSION_STRING "${ZLIB_H}")
ENDIF()
-# Per-recommendation
-SET(ZLIB_INCLUDE_DIRS "${ZLIB_INCLUDE_DIR}")
-SET(ZLIB_LIBRARIES "${ZLIB_LIBRARY}")
-
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_INCLUDE_DIR ZLIB_LIBRARY)
+
+IF (ZLIB_FOUND)
+ SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
+ SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+ENDIF()