Last changes made ImageMagick-6 work, but broke ImageMagick-5.
The issue is that the _ARCH_INCLUDE directories are only present
for ImageMagick-6 and newer. So, Cmake was attempting to use an
undefined variable.
LIST(APPEND ImageMagick_INCLUDE_DIRS
${ImageMagick_${component}_INCLUDE_DIR}
)
- LIST(APPEND ImageMagick_INCLUDE_DIRS
- ${ImageMagick_${component}_ARCH_INCLUDE_DIR}
- )
+ IF(EXISTS ${ImageMagick_${component}_ARCH_INCLUDE_DIR})
+ LIST(APPEND ImageMagick_INCLUDE_DIRS
+ ${ImageMagick_${component}_ARCH_INCLUDE_DIR}
+ )
+ ENDIF(EXISTS ${ImageMagick_${component}_ARCH_INCLUDE_DIR})
LIST(REMOVE_DUPLICATES ImageMagick_INCLUDE_DIRS)
SET(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS} PARENT_SCOPE)