]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add backward compatibility bookworm
authorBastian Dehn <hhaalo@arcor.de>
Wed, 22 Apr 2026 19:18:25 +0000 (21:18 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 23 Apr 2026 14:41:47 +0000 (16:41 +0200)
builder/Containerfile.template
builder/build-in-container
src/CMakeLists.txt
src/kds_s2000w_image_converter_magick.c
tests/CMakeLists.txt

index 9026facf9c4d5b0b6f2e46a079eb7589dd53a7f4..9698807d6e033d7abbe47e92a99a881ad10c7aa7 100644 (file)
@@ -14,6 +14,7 @@ RUN apt-get install -y \
     libcmocka-dev \
     cppcheck \
     lcov \
+    imagemagick \
     libmagickcore-dev \
     && apt-get clean
 COPY run /app/run
index 7a5d52ed9006343d133dc4b7e45b72b1aa253313..f2267742a8e288b95cb7c869771bc7c30a80f7e7 100755 (executable)
@@ -3,7 +3,7 @@
 main()
 {
        local scriptpath=$(echo $0 | xargs dirname | xargs realpath)
-       local distros="debian:trixie debian:forky"
+       local distros="debian:bookworm debian:trixie debian:forky"
        mkdir -p build
        cp builder/run build/
 
index 4c357d64e4018f4843ff6c94eb3bf3c55914b821..0c4a638df0d36f9aa53b8963e02184ce73ad2757 100644 (file)
@@ -40,6 +40,7 @@ if(IMAGEMAGICK)
        find_package(ImageMagick COMPONENTS MagickCore REQUIRED)
        message(STATUS "find ImageMagick: ${ImageMagick_LIBRARIES}")
        message(STATUS "ImageMagick_INCLUDE_DIRS: ${ImageMagick_INCLUDE_DIRS}")
+       message(STATUS "ImageMagick_VERSION_STRING: ${ImageMagick_VERSION_STRING}")
 else()
        find_library(netpbm NAMES netpbm REQUIRED)
        message(STATUS "find netpbm: ${netpbm}")
@@ -49,6 +50,10 @@ else()
        message(STATUS "find tiff: ${TIFF_LIBRARIES}")
 endif()
 
+if(ImageMagick_VERSION_STRING VERSION_LESS 7)
+       add_compile_definitions(IMAGEMAGICK6)
+endif()
+
 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
        set(CMAKE_INSTALL_PREFIX / CACHE PATH "install prefix" FORCE)
 endif()
index f3f74cb6fbb432e2cd1de03d340c734bd1a8694b..8a6c70c92b109e208ef00354c40e893b3bdae426 100644 (file)
@@ -1,7 +1,11 @@
 #define MAGICKCORE_QUANTUM_DEPTH 16
 #define MAGICKCORE_HDRI_ENABLE 0
 
-#include <MagickCore/MagickCore.h>
+#ifdef IMAGEMAGICK6
+       #include <magick/MagickCore.h>
+#else
+       #include <MagickCore/MagickCore.h>
+#endif
 #include <string.h>
 #include "kds_s2000w_image_converter.h"
 #include "kds_s2000w_image_type_check.h"
index ecfa30164116ef1fbaf83ee2173d5b7297b2b09f..498929dfc0fb4875607f533952cdf136373827d2 100644 (file)
@@ -8,6 +8,11 @@ message(STATUS "find ${CMOCKA_LIBRARY}")
 message(STATUS "find ${CPPCHECK}")
 message(STATUS "find ${LCOV}")
 
+execute_process(COMMAND bash -c "${CPPCHECK} --version | sed 's/Cppcheck //'"
+       OUTPUT_VARIABLE CPPCHECK_VERSION)
+
+message(STATUS "CPPCHECK_VERSION: ${CPPCHECK_VERSION}")
+
 add_executable(kds_s2000w_net_get_opt_tests
        kds_s2000w_net_get_opt_tests.c
        kds_s2000w_client_mock.c)
@@ -127,12 +132,23 @@ add_custom_command(TARGET runningtests
                --output-directory ${CMAKE_BINARY_DIR}/coverage
                ${CMAKE_BINARY_DIR}/coverage.info)
 
-add_custom_command(TARGET runningtests
-       POST_BUILD
-       COMMAND ${CPPCHECK}
-               --check-level=exhaustive
-               --enable=warning,style
-               --inline-suppr
-               --error-exitcode=1
-               ${CMAKE_SOURCE_DIR}/src
-               ${CMAKE_SOURCE_DIR}/tests)
\ No newline at end of file
+if(CPPCHECK_VERSION VERSION_GREATER 2.10)
+       add_custom_command(TARGET runningtests
+               POST_BUILD
+               COMMAND ${CPPCHECK}
+                       --check-level=exhaustive
+                       --enable=warning,style
+                       --inline-suppr
+                       --error-exitcode=1
+                       ${CMAKE_SOURCE_DIR}/src
+                       ${CMAKE_SOURCE_DIR}/tests)
+else()
+       add_custom_command(TARGET runningtests
+               POST_BUILD
+               COMMAND ${CPPCHECK}
+                       --enable=warning,style
+                       --inline-suppr
+                       --error-exitcode=1
+                       ${CMAKE_SOURCE_DIR}/src
+                       ${CMAKE_SOURCE_DIR}/tests)
+endif()
\ No newline at end of file