]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
include image magick version 6 with define
authorBastian Dehn <hhaalo@arcor.de>
Sat, 14 Dec 2024 11:39:05 +0000 (12:39 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 14 Dec 2024 11:39:05 +0000 (12:39 +0100)
src/CMakeLists.txt
src/kds_s2000w_image_converter.c

index 2a00f85f4ffab304fee36f9b1645ac7d66b59e12..b6d56d0daa61abc7bfe7d5e53a803fd996a78d89 100644 (file)
@@ -33,6 +33,8 @@ FIND_PACKAGE(JSON-C REQUIRED)
 MESSAGE(STATUS "find json-c: " ${JSON\-C_DIR})
 FIND_PACKAGE(ImageMagick COMPONENTS MagickCore REQUIRED)
 MESSAGE(STATUS "find ImageMagick: " ${ImageMagick_LIBRARIES})
+STRING(SUBSTRING ${ImageMagick_VERSION_STRING} 0 1 ImageMagick_MAJOR_VERSION)
+ADD_COMPILE_DEFINITIONS(IMAGE_MAGICK_MAJOR=${ImageMagick_MAJOR_VERSION})
 
 IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
        SET(CMAKE_INSTALL_PREFIX "/" CACHE PATH "install prefix" FORCE)
index ef36412926fff40c7bc69d438deba0d3918d2847..28a199ebe5c213f18c555bdc63e87d55580d3e23 100644 (file)
@@ -1,9 +1,15 @@
 #define MAGICKCORE_QUANTUM_DEPTH 16
 #define MAGICKCORE_HDRI_ENABLE 0
 
+#ifndef IMAGE_MAGICK_MAJOR
+#define IMAGE_MAGICK_MAJOR 6
+#endif
+
 #include <stdio.h>
 #include <string.h>
+#if IMAGE_MAGICK_MAJOR == 6
 #include <magick/MagickCore.h>
+#endif
 #include "kds_s2000w_image_converter.h"
 
 #ifndef NODEBUG