Merge topic 'FindImageMagick-arch-include-dir'

1342e022 FindImageMagick: Provide per-component include dirs (#15007)
6f5581c1 FindImageMagick: Find arch include dir (#15007)
This commit is contained in:
Brad King 2014-07-28 10:35:47 -04:00 committed by CMake Topic Stage
commit 95c47f6d37
1 changed files with 26 additions and 2 deletions

View File

@ -115,7 +115,19 @@ function(FIND_IMAGEMAGICK_API component header)
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/include"
PATH_SUFFIXES
ImageMagick ImageMagick-6
DOC "Path to the ImageMagick include dir."
DOC "Path to the ImageMagick arch-independent include dir."
)
find_path(ImageMagick_${component}_ARCH_INCLUDE_DIR
NAMES magick/magick-baseconfig.h
HINTS
${PC_${component}_INCLUDEDIR}
${PC_${component}_INCLUDE_DIRS}
PATHS
${ImageMagick_INCLUDE_DIRS}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/include"
PATH_SUFFIXES
ImageMagick ImageMagick-6
DOC "Path to the ImageMagick arch-specific include dir."
)
find_library(ImageMagick_${component}_LIBRARY
NAMES ${ARGN}
@ -127,12 +139,24 @@ function(FIND_IMAGEMAGICK_API component header)
DOC "Path to the ImageMagick Magick++ library."
)
# old version have only indep dir
if(ImageMagick_${component}_INCLUDE_DIR AND ImageMagick_${component}_LIBRARY)
set(ImageMagick_${component}_FOUND TRUE PARENT_SCOPE)
list(APPEND ImageMagick_INCLUDE_DIRS
# Construct per-component include directories.
set(ImageMagick_${component}_INCLUDE_DIRS
${ImageMagick_${component}_INCLUDE_DIR}
)
if(ImageMagick_${component}_ARCH_INCLUDE_DIR)
list(APPEND ImageMagick_${component}_INCLUDE_DIRS
${ImageMagick_${component}_ARCH_INCLUDE_DIR})
endif()
list(REMOVE_DUPLICATES ImageMagick_${component}_INCLUDE_DIRS)
set(ImageMagick_${component}_INCLUDE_DIRS
${ImageMagick_${component}_INCLUDE_DIRS} PARENT_SCOPE)
# Add the per-component include directories to the full include dirs.
list(APPEND ImageMagick_INCLUDE_DIRS ${ImageMagick_${component}_INCLUDE_DIRS})
list(REMOVE_DUPLICATES ImageMagick_INCLUDE_DIRS)
set(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS} PARENT_SCOPE)