[Cmake-commits] CMake branch, next, updated. v2.8.6-2078-g5574e35

Brad King brad.king at kitware.com
Wed Nov 30 13:22:50 EST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  5574e35fc4ca555f574ec19946661e8a140030b5 (commit)
       via  985dee4f548451745b6065fd4c23aad9e2ce117b (commit)
       via  17388037fdf435295dac220a482a16b05c621a19 (commit)
      from  78e759fa4a544007c6b1ddcfab4bf48c5f1e092a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5574e35fc4ca555f574ec19946661e8a140030b5
commit 5574e35fc4ca555f574ec19946661e8a140030b5
Merge: 78e759f 985dee4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Nov 30 13:22:49 2011 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Nov 30 13:22:49 2011 -0500

    Merge topic 'FindZLIB-use-ZLIB_ROOT' into next
    
    985dee4 FindZLIB: Search under ZLIB_ROOT if it is set
    1738803 KWSys Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=985dee4f548451745b6065fd4c23aad9e2ce117b
commit 985dee4f548451745b6065fd4c23aad9e2ce117b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Nov 30 08:40:58 2011 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Nov 30 13:18:07 2011 -0500

    FindZLIB: Search under ZLIB_ROOT if it is set
    
    Perform multiple separate searches in order.  If ZLIB_ROOT is set search
    it exclusively so it takes precedence over CMAKE_PREFIX_PATH.  This
    allows a user to provide -DZLIB_ROOT=/path/to/zlib/prefix on the CMake
    command line to tell it exactly where to find zlib.  Otherwise fall back
    to a normal search.
    
    Inspired-by: Andreas Schneider <asn at cryptomilk.org>

diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index 77f9fda..166e291 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -17,9 +17,12 @@
 #  ZLIB_MAJOR_VERSION  - The major version of zlib
 #  ZLIB_MINOR_VERSION  - The minor version of zlib
 #  ZLIB_PATCH_VERSION  - The patch version of zlib
+#
+# An includer may set ZLIB_ROOT to a zlib installation root to tell
+# this module where to look.
 
 #=============================================================================
-# Copyright 2001-2009 Kitware, Inc.
+# Copyright 2001-2011 Kitware, Inc.
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -31,17 +34,29 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/include"
-)
+SET(_ZLIB_SEARCHES)
+
+# Search ZLIB_ROOT first if it is set.
+IF(ZLIB_ROOT)
+  SET(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
+  LIST(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)
+ENDIF()
+
+# Normal search.
+SET(_ZLIB_SEARCH_NORMAL
+  PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
+        "$ENV{PROGRAMFILES}/zlib"
+  )
+LIST(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
 
 SET(ZLIB_NAMES z zlib zdll zlib1 zlibd zlibd1)
-FIND_LIBRARY(ZLIB_LIBRARY
-    NAMES
-        ${ZLIB_NAMES}
-    PATHS
-        "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/lib"
-)
+
+# Try each search configuration.
+FOREACH(search ${_ZLIB_SEARCHES})
+  FIND_PATH(ZLIB_INCLUDE_DIR NAMES zlib.h        ${${search}} PATH_SUFFIXES include)
+  FIND_LIBRARY(ZLIB_LIBRARY  NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
+ENDFOREACH()
+
 MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
 
 IF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")

-----------------------------------------------------------------------

Summary of changes:
 Modules/FindZLIB.cmake            |   35 +++++++++++++++++++++++++----------
 Source/kwsys/kwsysDateStamp.cmake |    2 +-
 2 files changed, 26 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list