summaryrefslogtreecommitdiffstats
path: root/Modules/FindBZip2.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-06-05 20:01:54 (GMT)
committerBrad King <brad.king@kitware.com>2012-06-05 20:01:54 (GMT)
commit7c912af2d06caeb0632b3f26cc9ee9bd8f0e6076 (patch)
treedd4282f29851732bea8e96c8c2d2a30069deba48 /Modules/FindBZip2.cmake
parent7687d557dc9a04c56ca9d9e943ff8e21ac8eb028 (diff)
downloadCMake-7c912af2d06caeb0632b3f26cc9ee9bd8f0e6076.zip
CMake-7c912af2d06caeb0632b3f26cc9ee9bd8f0e6076.tar.gz
CMake-7c912af2d06caeb0632b3f26cc9ee9bd8f0e6076.tar.bz2
FindBZip2: Search locations in GnuWin32 registry
The GnuWin32 "bzip2" installer stores in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\GnuWin32\Bzip2 an "InstallPath" value. Use this entry as a search location.
Diffstat (limited to 'Modules/FindBZip2.cmake')
-rw-r--r--Modules/FindBZip2.cmake10
1 files changed, 7 insertions, 3 deletions
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index 7130192..ce7f255 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -22,11 +22,15 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h )
+SET(_BZIP2_PATHS PATHS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Bzip2;InstallPath]"
+ )
+
+FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h ${_BZIP2_PATHS} PATH_SUFFIXES include)
IF (NOT BZIP2_LIBRARIES)
- FIND_LIBRARY(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 )
- FIND_LIBRARY(BZIP2_LIBRARY_DEBUG NAMES bzip2d )
+ FIND_LIBRARY(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 ${_BZIP2_PATHS} PATH_SUFFIXES lib)
+ FIND_LIBRARY(BZIP2_LIBRARY_DEBUG NAMES bzip2d ${_BZIP2_PATHS} PATH_SUFFIXES lib)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
SELECT_LIBRARY_CONFIGURATIONS(BZIP2)