diff --git a/SuperBuild/External-OPENJPEG.cmake b/SuperBuild/External-OPENJPEG.cmake index 38f73016..e619696c 100644 --- a/SuperBuild/External-OPENJPEG.cmake +++ b/SuperBuild/External-OPENJPEG.cmake @@ -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" diff --git a/SuperBuild/External-YAML-CPP.cmake b/SuperBuild/External-YAML-CPP.cmake index ada7d8f5..6233d6b8 100644 --- a/SuperBuild/External-YAML-CPP.cmake +++ b/SuperBuild/External-YAML-CPP.cmake @@ -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" diff --git a/SuperBuild/SuperBuild.cmake b/SuperBuild/SuperBuild.cmake index 969b95a9..b318aff9 100644 --- a/SuperBuild/SuperBuild.cmake +++ b/SuperBuild/SuperBuild.cmake @@ -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) diff --git a/console/CMakeLists.txt b/console/CMakeLists.txt index 8e98cdc4..54d9749d 100644 --- a/console/CMakeLists.txt +++ b/console/CMakeLists.txt @@ -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 () diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 6b76bb21..375d5c41 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -50,7 +50,7 @@ #include #endif #ifndef myDisableOpenJPEG - #include + #include "openjpeg.h" #ifdef myEnableJasper ERROR: YOU CAN NOT COMPILE WITH myEnableJasper AND NOT myDisableOpenJPEG OPTIONS SET SIMULTANEOUSLY