From: Matthias Maier Date: Tue, 12 Sep 2017 15:45:51 +0000 (-0500) Subject: CMake: Respect BZIP2_DIR in FindBZIP2.cmake X-Git-Tag: v9.0.0-rc1~1090^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5066%2Fhead;p=dealii.git CMake: Respect BZIP2_DIR in FindBZIP2.cmake --- diff --git a/cmake/modules/FindBZIP2.cmake b/cmake/modules/FindBZIP2.cmake index e09106c6af..973ccbc74b 100644 --- a/cmake/modules/FindBZIP2.cmake +++ b/cmake/modules/FindBZIP2.cmake @@ -23,15 +23,19 @@ # BZIP2_VERSION # -# -# Houston, we have a problem: CMake ships its own FindBZip2.cmake module. -# Unfortunately we want to call DEAL_II_PACKAGE_HANDLE. Therefore, use the -# original find module and do a dummy call to DEAL_II_PACKAGE_HANDLE: -# +SET(BZIP2_DIR "" CACHE PATH "An optional hint to a BZIP2 installation") +SET_IF_EMPTY(BZIP2_DIR "$ENV{BZIP2_DIR}") + +SET(_cmake_prefix_path_backup "${CMAKE_PREFIX_PATH}") # temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) + +SET(CMAKE_PREFIX_PATH ${BZIP2_DIR} ${_cmake_prefix_path_backup}) + FIND_PACKAGE(BZip2) + +SET(CMAKE_PREFIX_PATH ${_cmake_prefix_path_backup}) LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) SET(BZIP2_VERSION ${BZIP2_VERSION_STRING})