[Cmake-commits] CMake branch, next, updated. v2.8.7-2103-g5dd320e

Rolf Eike Beer eike at sf-mail.de
Sun Jan 15 14:28:57 EST 2012


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  5dd320e9e9b27deb83dcb624a935de7f78482226 (commit)
       via  0daa154605cd02ddb46c7be13cd6fc2bcabddb76 (commit)
      from  50a965d65241c0ec4a175ab466d5b272f191c3c8 (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=5dd320e9e9b27deb83dcb624a935de7f78482226
commit 5dd320e9e9b27deb83dcb624a935de7f78482226
Merge: 50a965d 0daa154
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sun Jan 15 14:28:50 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jan 15 14:28:50 2012 -0500

    Merge topic 'improve-findbzip2' into next
    
    0daa154 FindBZip2: add support for debug libraries (#12867)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0daa154605cd02ddb46c7be13cd6fc2bcabddb76
commit 0daa154605cd02ddb46c7be13cd6fc2bcabddb76
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Tue Jan 10 14:12:09 2012 +0100
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Sun Jan 15 20:28:26 2012 +0100

    FindBZip2: add support for debug libraries (#12867)
    
    The debug library has a different name on Windows. Make sure both versions
    work.
    
    Thanks to Patrick Spendrin for testing this.

diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index 25dfad0..4a05cef 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -8,8 +8,9 @@
 #  BZIP2_VERSION_STRING - the version of BZip2 found (x.y.z)
 
 #=============================================================================
-# Copyright 2006-2009 Kitware, Inc.
+# Copyright 2006-2012 Kitware, Inc.
 # Copyright 2006 Alexander Neundorf <neundorf at kde.org>
+# Copyright 2012 Rolf Eike Beer <eike at sf-mail.de>
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -23,12 +24,21 @@
 
 FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h )
 
-FIND_LIBRARY(BZIP2_LIBRARIES NAMES bz2 bzip2 )
+IF (NOT BZIP2_LIBRARIES)
+    FIND_LIBRARY(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 )
+    FIND_LIBRARY(BZIP2_LIBRARY_DEBUG NAMES bzip2d bz2 bzip2 )
 
-IF(BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
+    IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+        SET(BZIP2_LIBRARIES optimized "${BZIP2_LIBRARY_RELEASE}" debug "${BZIP2_LIBRARY_DEBUG}")
+    ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+        SET(BZIP2_LIBRARIES "${BZIP2_LIBRARY_RELEASE}")
+    ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ENDIF (NOT BZIP2_LIBRARIES)
+
+IF (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
     FILE(STRINGS "${BZIP2_INCLUDE_DIR}/bzlib.h" BZLIB_H REGEX "bzip2/libbzip2 version [0-9]+\\.[^ ]+ of [0-9]+ ")
     STRING(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}")
-ENDIF(BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
+ENDIF (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
 
 # handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if 
 # all listed variables are TRUE
@@ -39,8 +49,14 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
 
 IF (BZIP2_FOUND)
    INCLUDE(CheckLibraryExists)
-   CHECK_LIBRARY_EXISTS(${BZIP2_LIBRARIES} BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
+   # Make sure there is always a library to do the compile test.
+   # If the user chooses a build configuration without a compatible library
+   # this is a different problem.
+   IF (BZIP2_LIBRARY_DEBUG AND NOT BZIP2_LIBRARY_RELEASE)
+       CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARY_DEBUG}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
+   ELSE (BZIP2_LIBRARY_DEBUG AND NOT BZIP2_LIBRARY_RELEASE)
+       CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
+   ENDIF (BZIP2_LIBRARY_DEBUG AND NOT BZIP2_LIBRARY_RELEASE)
 ENDIF (BZIP2_FOUND)
 
-MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARIES)
-
+MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARY_DEBUG BZIP2_LIBRARY_RELEASE)

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list