[Cmake-commits] CMake branch, next, updated. v2.8.7-2099-g74f785f
Rolf Eike Beer
eike at sf-mail.de
Sun Jan 15 10:11:09 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 74f785fed3dc44a02265e13c505033918f813ad9 (commit)
via 75fc77fcdf7e5d76ae9b08728572f08dfe0d010c (commit)
from 8a05d80f33db1d5c200fecedd806127abfb763bb (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=74f785fed3dc44a02265e13c505033918f813ad9
commit 74f785fed3dc44a02265e13c505033918f813ad9
Merge: 8a05d80 75fc77f
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sun Jan 15 10:10:59 2012 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jan 15 10:10:59 2012 -0500
Merge topic 'improve-findbzip2' into next
75fc77f FindBZip2: add support for debug libraries (#12867)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=75fc77fcdf7e5d76ae9b08728572f08dfe0d010c
commit 75fc77fcdf7e5d76ae9b08728572f08dfe0d010c
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 16:10:02 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..aec5716 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_LIBRARIES_RELEASE NAMES bz2 bzip2 )
+ FIND_LIBRARY(BZIP2_LIBRARIES_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_LIBRARIES_RELEASE}" debug "${BZIP2_LIBRARIES_DEBUG}")
+ ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(BZIP2_LIBRARIES "${BZIP2_LIBRARIES_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_LIBRARIES_DEBUG AND NOT BZIP2_LIBRARIES_RELEASE)
+ CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES_DEBUG}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
+ ELSE (BZIP2_LIBRARIES_DEBUG AND NOT BZIP2_LIBRARIES_RELEASE)
+ CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
+ ENDIF (BZIP2_LIBRARIES_DEBUG AND NOT BZIP2_LIBRARIES_RELEASE)
ENDIF (BZIP2_FOUND)
-MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARIES)
-
+MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARIES_DEBUG BZIP2_LIBRARIES_RELEASE)
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list