ngompa / rpms / cmake

Forked from rpms/cmake 4 years ago
Clone
Blob Blame History Raw
diff -Nrup a/Modules/FindImageMagick.cmake b/Modules/FindImageMagick.cmake
--- a/Modules/FindImageMagick.cmake	2014-01-16 12:15:08.000000000 -0500
+++ b/Modules/FindImageMagick.cmake	2016-02-29 23:07:06.439208172 -0500
@@ -69,17 +69,24 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+find_package(PkgConfig QUIET)
+
 #---------------------------------------------------------------------
 # Helper functions
 #---------------------------------------------------------------------
 function(FIND_IMAGEMAGICK_API component header)
   set(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE)
 
+  pkg_check_modules(PC_${component} QUIET ${component})
+
   find_path(ImageMagick_${component}_INCLUDE_DIR
     NAMES ${header}
     PATHS
       ${ImageMagick_INCLUDE_DIRS}
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/include"
+    HINTS
+      ${PC_${component}_INCLUDEDIR}
+      ${PC_${component}_INCLUDE_DIRS}
     PATH_SUFFIXES
       ImageMagick ImageMagick-6
     DOC "Path to the ImageMagick include dir."
@@ -88,6 +95,9 @@ function(FIND_IMAGEMAGICK_API component 
     NAMES ${ARGN}
     PATHS
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/lib"
+    HINTS
+      ${PC_${component}_LIBDIR}
+      ${PC_${component}_LIB_DIRS}
     DOC "Path to the ImageMagick Magick++ library."
     )