Am 21.07.2015 um 15:46 schrieb Brad King:
> Rather than (or in addition to) changing to _BZ2_decompress, please look
> at changing the check to use CheckSymbolExists.  It allows the actual
> header to be included so we can test using the library the way the
> project will.  That is likely more robust.  Note that you may need
> to set CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_LIBRARIES to make
> sure the check is run with the desired bzip2 library.
Changed to use CheckSymbolExists, see append patch.

Regards
Ralf

--- a/Modules/FindBZip2.cmake	2015-07-21 15:53:01.529240144 +0200
+++ b/Modules/FindBZip2.cmake	2015-07-21 16:23:19.789187460 +0200
@@ -56,11 +56,12 @@
                                   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_LIBRARIES ${BZIP2_LIBRARIES})
+   CHECK_SYMBOL_EXISTS(BZ2_bzCompressInit "bzlib.h" BZIP2_NEED_PREFIX)
    cmake_pop_check_state()
 endif ()
 
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to