Skip to content

Commit

Permalink
Fix OpenJPEG build.
Browse files Browse the repository at this point in the history
  • Loading branch information
ningfei committed Jun 9, 2017
1 parent 2b60ec5 commit 0102f8b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SuperBuild/External-OPENJPEG.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(OPENJPEG_TAG 151e322) # version openjepg-2.1
set(OPENJPEG_TAG v2.1-static) # version v2.1-static

ExternalProject_Add(openjpeg
GIT_REPOSITORY "${git_protocol}://github.com/ningfei/openjpeg.git"
Expand Down
2 changes: 1 addition & 1 deletion SuperBuild/External-YAML-CPP.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(YAML-CPP_TAG 5c3cb09) # version yaml-cpp-0.5.3
set(YAML-CPP_TAG yaml-cpp-0.5.3) # version yaml-cpp-0.5.3

ExternalProject_Add(yaml-cpp
GIT_REPOSITORY "${git_protocol}://github.com/ningfei/yaml-cpp.git"
Expand Down
1 change: 1 addition & 0 deletions SuperBuild/SuperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ endif()
# Basic CMake build settings
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release;RelWithDebInfo;MinSizeRel")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

option(USE_STATIC_RUNTIME "Use static runtime" ON)
Expand Down
9 changes: 9 additions & 0 deletions console/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ if(USE_OPENJPEG)
option(OpenJPEG_DIR "Path to OpenJPEG configuration file" "")

find_package(OpenJPEG)

if(WIN32)
if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
else()
add_definitions(-DOPJ_STATIC)
endif()
endif()

target_include_directories(dcm2niix PRIVATE ${OPENJPEG_INCLUDE_DIRS})
target_link_libraries(dcm2niix ${OPENJPEG_LIBRARIES})
else ()
Expand Down
2 changes: 1 addition & 1 deletion console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <jasper/jasper.h>
#endif
#ifndef myDisableOpenJPEG
#include <openjpeg.h>
#include "openjpeg.h"

#ifdef myEnableJasper
ERROR: YOU CAN NOT COMPILE WITH myEnableJasper AND NOT myDisableOpenJPEG OPTIONS SET SIMULTANEOUSLY
Expand Down

0 comments on commit 0102f8b

Please sign in to comment.