summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2015-07-21 16:10:16 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-21 18:00:06 (GMT)
commit23876eda9f1d4b5725407aef7d218fc3ce4113cb (patch)
treeedc5ef710f4da38ea3665af38b5d8af1aebc3045
parent265b9db7c2c865c5aad821bf9a377ea84dfe431e (diff)
downloadCMake-23876eda9f1d4b5725407aef7d218fc3ce4113cb.zip
CMake-23876eda9f1d4b5725407aef7d218fc3ce4113cb.tar.gz
CMake-23876eda9f1d4b5725407aef7d218fc3ce4113cb.tar.bz2
FindBZip2: Check BZIP2_NEED_PREFIX with real prototype
Run our check for the '_' prefix using a bzip2 API function as declared with a prototype in the real header file. This is needed in case the function is provided in a DLL import library where the symbol name may not match without proper markup from the header.
-rw-r--r--Modules/FindBZip2.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index b479332..6af42dd 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -56,11 +56,13 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
VERSION_VAR BZIP2_VERSION_STRING)
if (BZIP2_FOUND)
- include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
+ include(${CMAKE_CURRENT_LIST_DIR}/CheckSymbolExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
cmake_push_check_state()
set(CMAKE_REQUIRED_QUIET ${BZip2_FIND_QUIETLY})
- CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
+ set(CMAKE_REQUIRED_INCLUDES ${BZIP2_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_LIBRARIES ${BZIP2_LIBRARIES})
+ CHECK_SYMBOL_EXISTS(BZ2_bzCompressInit "bzlib.h" BZIP2_NEED_PREFIX)
cmake_pop_check_state()
endif ()