Skip to content

Commit

Permalink
Update to OpenJPEG 2.5.0 (#55)
Browse files Browse the repository at this point in the history
* use OpenJPEG 2.5.0
* patch CMakeLists.txt file for version 2.5.0
* enforce static linking

Co-authored-by: Paul Konstantin Gerke <[email protected]>
  • Loading branch information
jmsmkn and pkcakeout authored Dec 16, 2022
1 parent 7ac26f0 commit bffbba6
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 13 deletions.
54 changes: 43 additions & 11 deletions build_tools/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ endif()
#string(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME)
set(OPENJPEG_LIBRARY_NAME openjp2)

project(${OPENJPEG_NAMESPACE})
project(${OPENJPEG_NAMESPACE} C)

# Do full dependency headers.
include_regular_expression("^.*$")

#-----------------------------------------------------------------------------
# OPENJPEG version number, useful for packaging and doxygen doc:
set(OPENJPEG_VERSION_MAJOR 2)
set(OPENJPEG_VERSION_MINOR 3)
set(OPENJPEG_VERSION_BUILD 1)
set(OPENJPEG_VERSION_MINOR 5)
set(OPENJPEG_VERSION_BUILD 0)
set(OPENJPEG_VERSION
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
set(PACKAGE_VERSION
Expand All @@ -36,7 +36,40 @@ endif(NOT OPENJPEG_SOVERSION)
set(OPENJPEG_LIBRARY_PROPERTIES
VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}"
SOVERSION "${OPENJPEG_SOVERSION}"
)
)

# --------------------------------------------------------------------------
# Path to additional CMake modules
set(CMAKE_MODULE_PATH
${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake
${CMAKE_MODULE_PATH})

# --------------------------------------------------------------------------
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
# warnings
if(WIN32)
if(NOT BORLAND)
if(NOT CYGWIN)
if(NOT MINGW)
if(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
add_definitions(
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE
-D_CRT_IS_WCTYPE_NO_DEPRECATE
-D_CRT_MANAGED_FP_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE
-D_CRT_SECURE_NO_DEPRECATE
-D_CRT_SECURE_NO_DEPRECATE_GLOBALS
-D_CRT_SETERRORMODE_BEEP_SLEEP_NO_DEPRECATE
-D_CRT_TIME_FUNCTIONS_NO_DEPRECATE
-D_CRT_VCCLRIT_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE
)
endif()
endif()
endif()
endif()
endif()


# --------------------------------------------------------------------------
# Install directories
Expand All @@ -46,22 +79,21 @@ endif()

set(OPENJPEG_INSTALL_PACKAGE_DIR "../interface")

# --------------------------------------------------------------------------
# Path to additional CMake modules
set(CMAKE_MODULE_PATH
${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake
${CMAKE_MODULE_PATH})

set(OPENJPEG_INSTALL_INCLUDE_DIR
"../interface"
)

option(BUILD_JPIP "Build the JPIP library and executables." OFF)
option(BUILD_JPWL off)
option(BUILD_MJ2 off)
option(BUILD_JPIP off)
option(BUILD_JP3D off)

#-----------------------------------------------------------------------------
# Big endian test:
if (NOT EMSCRIPTEN)
include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN)
endif()


#-----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion openjpeg/src/openjpeg
Submodule openjpeg updated 212 files
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def setup_oj():
setup_oj()

# Compiler and linker arguments
extra_compile_args = []
extra_compile_args = ["-DOPJ_STATIC"]
extra_link_args = []

# Maybe use cythonize instead
Expand Down

0 comments on commit bffbba6

Please sign in to comment.