loader: Fixed issue with Linux when ImageMagick-5 installed.
authorMark Young <marky@lunarg.com>
Tue, 26 Jan 2016 18:27:09 +0000 (11:27 -0700)
committerMark Young <marky@lunarg.com>
Tue, 26 Jan 2016 18:27:09 +0000 (11:27 -0700)
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.

cmake/FindImageMagick.cmake

index 49cf443..ccf0a01 100644 (file)
@@ -155,9 +155,11 @@ FUNCTION(FIND_IMAGEMAGICK_API component header)
     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)