Skip to content

Commit

Permalink
Avoid using GDCM's internal OpenJPEG library.
Browse files Browse the repository at this point in the history
  • Loading branch information
ningfei committed Nov 19, 2018
1 parent 80e1404 commit e02f1e4
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions SuperBuild/SuperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand All @@ -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()
Expand All @@ -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)
Expand Down

0 comments on commit e02f1e4

Please sign in to comment.