]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Respect BZIP2_DIR in FindBZIP2.cmake 5066/head
authorMatthias Maier <tamiko@43-1.org>
Tue, 12 Sep 2017 15:45:51 +0000 (10:45 -0500)
committerMatthias Maier <tamiko@43-1.org>
Tue, 12 Sep 2017 15:48:57 +0000 (10:48 -0500)
cmake/modules/FindBZIP2.cmake

index e09106c6af8caa42fc9952e0f576800a9ecc01bb..973ccbc74b3e11f961261cb24770e3f0b0b9a2f0 100644 (file)
 #   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})

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.