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}")
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()
#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"
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)
--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