Merge topic 'FindImageMagick-pkgconfig'

90245fe8 FindImageMagick: Use pkgconfig hints if available (#14012)
This commit is contained in:
Brad King 2014-07-15 10:48:15 -04:00 committed by CMake Topic Stage
commit d3076b1d51
1 changed files with 10 additions and 0 deletions

View File

@ -95,14 +95,21 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
find_package(PkgConfig QUIET)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Helper functions # Helper functions
#--------------------------------------------------------------------- #---------------------------------------------------------------------
function(FIND_IMAGEMAGICK_API component header) function(FIND_IMAGEMAGICK_API component header)
set(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE) set(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE)
pkg_check_modules(PC_${component} QUIET ${component})
find_path(ImageMagick_${component}_INCLUDE_DIR find_path(ImageMagick_${component}_INCLUDE_DIR
NAMES ${header} NAMES ${header}
HINTS
${PC_${component}_INCLUDEDIR}
${PC_${component}_INCLUDE_DIRS}
PATHS PATHS
${ImageMagick_INCLUDE_DIRS} ${ImageMagick_INCLUDE_DIRS}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/include" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/include"
@ -112,6 +119,9 @@ function(FIND_IMAGEMAGICK_API component header)
) )
find_library(ImageMagick_${component}_LIBRARY find_library(ImageMagick_${component}_LIBRARY
NAMES ${ARGN} NAMES ${ARGN}
HINTS
${PC_${component}_LIBDIR}
${PC_${component}_LIB_DIRS}
PATHS PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/lib" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/lib"
DOC "Path to the ImageMagick Magick++ library." DOC "Path to the ImageMagick Magick++ library."