diff --git a/SuperBuild/SuperBuild.cmake b/SuperBuild/SuperBuild.cmake index 35735797..706907d6 100644 --- a/SuperBuild/SuperBuild.cmake +++ b/SuperBuild/SuperBuild.cmake @@ -60,21 +60,24 @@ if(USE_OPENJPEG) if(OpenJPEG_DIR) set(OpenJPEG_DIR "${OpenJPEG_DIR}" CACHE PATH "Path to OpenJPEG configuration file" FORCE) - message("-- Using OpenJPEG library from ${OpenJPEG_DIR}") + message("-- Using OpenJPEG library from ${OpenJPEG_DIR}") else() find_package(PkgConfig) if(PKG_CONFIG_FOUND) pkg_check_modules(OPENJPEG libopenjp2) endif() - if(OPENJPEG_FOUND) - set(OpenJPEG_DIR ${OPENJPEG_LIBDIR}/openjepg-2.1 CACHE PATH "Path to OpenJPEG configuration file" FORCE) - message("-- Using OpenJPEG library from ${OpenJPEG_DIR}") + if(OPENJPEG_FOUND AND NOT ${OPENJPEG_INCLUDE_DIRS} MATCHES "gdcmopenjpeg") + set(OpenJPEG_DIR ${OPENJPEG_LIBDIR}/openjpeg-2.1 CACHE PATH "Path to OpenJPEG configuration file" FORCE) + message("-- Using OpenJPEG library from ${OpenJPEG_DIR}") else() + if(${OPENJPEG_INCLUDE_DIRS} MATCHES "gdcmopenjpeg") + message("-- Unable to use GDCM's internal OpenJPEG") + endif() include(${CMAKE_SOURCE_DIR}/SuperBuild/External-OPENJPEG.cmake) list(APPEND DEPENDENCIES openjpeg) set(BUILD_OPENJPEG TRUE) - message("-- Will build OpenJPEG library from github") + message("-- Will build OpenJPEG library from github") endif() endif() endif() @@ -84,7 +87,7 @@ if(BATCH_VERSION) if(YAML-CPP_DIR) set(YAML-CPP_DIR ${YAML-CPP_DIR} CACHE PATH "Path to yaml-cpp configuration file" FORCE) - message("-- Using yaml-cpp library from ${YAML-CPP_DIR}") + message("-- Using yaml-cpp library from ${YAML-CPP_DIR}") else() find_package(PkgConfig) if(PKG_CONFIG_FOUND) @@ -94,12 +97,12 @@ if(BATCH_VERSION) # Build from github if not found or version < 0.5.3 if(YAML-CPP_FOUND AND NOT (YAML-CPP_VERSION VERSION_LESS "0.5.3")) set(YAML-CPP_DIR ${YAML-CPP_LIBDIR}/cmake/yaml-cpp CACHE PATH "Path to yaml-cpp configuration file" FORCE) - message("-- Using yaml-cpp library from ${YAML-CPP_DIR}") + message("-- Using yaml-cpp library from ${YAML-CPP_DIR}") else() include(${CMAKE_SOURCE_DIR}/SuperBuild/External-YAML-CPP.cmake) list(APPEND DEPENDENCIES yaml-cpp) set(BUILD_YAML-CPP TRUE) - message("-- Will build yaml-cpp library from github") + message("-- Will build yaml-cpp library from github") endif() endif() endif() @@ -111,7 +114,7 @@ if(${ZLIB_IMPLEMENTATION} STREQUAL "Cloudflare") include(${CMAKE_SOURCE_DIR}/SuperBuild/External-CLOUDFLARE-ZLIB.cmake) list(APPEND DEPENDENCIES zlib) set(BUILD_CLOUDFLARE-ZLIB TRUE) - message("-- Will build Cloudflare zlib from github") + message("-- Will build Cloudflare zlib from github") elseif(${ZLIB_IMPLEMENTATION} STREQUAL "Custom") set(ZLIB_ROOT ${ZLIB_ROOT} CACHE PATH "Specify custom zlib root directory.") if(NOT ZLIB_ROOT)