Skip to content

Commit

Permalink
Make sure that OpenJPEG compiles on Windows and is used by OIIO
Browse files Browse the repository at this point in the history
Signed-off-by: Cédrik Fuoco <[email protected]>
  • Loading branch information
cedrik-fuoco-adsk committed Sep 24, 2024
1 parent f9e45c7 commit c9880e3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cmake/dependencies/oiio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ LIST(APPEND _configure_options "-DJPEGTURBO_LIBRARY=${_jpegturbo_library}")
LIST(APPEND _configure_options "-DJPEGTURBO_INCLUDE_DIR=${_jpegturbo_include_dir}")

LIST(APPEND _configure_options "-DOpenJPEG_ROOT=${RV_DEPS_OPENJPEG_ROOT_DIR}")
GET_TARGET_PROPERTY(_openjpeg_library OpenJpeg::OpenJpeg IMPORTED_LOCATION)
GET_TARGET_PROPERTY(_openjpeg_library OpenJpeg::OpenJpeg IMPORTED_LOCATION)
GET_TARGET_PROPERTY(_openjpeg_include_dir OpenJpeg::OpenJpeg INTERFACE_INCLUDE_DIRECTORIES)
LIST(APPEND _configure_options "-DOPENJPEG_OPENJP2_LIBRARY=${_openjpeg_library}")
LIST(APPEND _configure_options "-DOPENJPEG_INCLUDE_DIR=${_openjpeg_include_dir}")
Expand Down Expand Up @@ -160,7 +160,7 @@ IF(NOT RV_TARGET_WINDOWS)
jpeg-turbo::jpeg
Tiff::Tiff
OpenEXR::OpenEXR
RV_DEPS_OPENJPEG
OpenJpeg::OpenJpeg
jpeg-turbo::turbojpeg
PNG::PNG
Boost::headers
Expand Down
21 changes: 15 additions & 6 deletions cmake/dependencies/openjpeg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ SET(_download_hash
"5cbb822a1203dd75b85639da4f4ecaab"
)

RV_MAKE_STANDARD_LIB_NAME("openjp2" "2.5.0" "SHARED" "")
IF(RV_TARGET_WINDOWS)
RV_MAKE_STANDARD_LIB_NAME("openjp2" "" "SHARED" "")
ELSE()
RV_MAKE_STANDARD_LIB_NAME("openjp2" "2.5.0" "SHARED" "")
ENDIF()


# The '_configure_options' list gets reset and initialized in 'RV_CREATE_STANDARD_DEPS_VARIABLES'

Expand Down Expand Up @@ -65,18 +70,22 @@ RV_COPY_LIB_BIN_FOLDERS()
ADD_DEPENDENCIES(dependencies ${_target}-stage-target)

ADD_LIBRARY(OpenJpeg::OpenJpeg SHARED IMPORTED GLOBAL)
ADD_DEPENDENCIES(OpenJpeg::OpenJpeg ${_target})

SET_PROPERTY(
TARGET OpenJpeg::OpenJpeg
PROPERTY IMPORTED_LOCATION ${_libpath}
)
SET_PROPERTY(
TARGET OpenJpeg::OpenJpeg
PROPERTY IMPORTED_SONAME ${_libname}
)

IF(RV_TARGET_WINDOWS)
SET_PROPERTY(
TARGET OpenJpeg::OpenJpeg
PROPERTY IMPORTED_IMPLIB ${_implibpath}
PROPERTY IMPORTED_IMPLIB ${_bin_dir}/${_implibname}
)
ELSE()
SET_PROPERTY(
TARGET OpenJpeg::OpenJpeg
PROPERTY IMPORTED_SONAME ${_libname}
)
ENDIF()

Expand Down

0 comments on commit c9880e3

Please sign in to comment.