Skip to content

Commit

Permalink
build: ensure libuhdr build recipe points to correct JPEG package
Browse files Browse the repository at this point in the history
Signed-off-by: loicvital <[email protected]>
  • Loading branch information
mugulmd committed Nov 5, 2024
1 parent 2a5fc74 commit e138b9a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/cmake/build_libuhdr.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ set (libuhdr_GIT_TAG "v${libuhdr_BUILD_VERSION}")
set_cache (libuhdr_BUILD_SHARED_LIBS OFF
DOC "Should execute a local libuhdr build, if necessary, build shared libraries" ADVANCED)

find_package(JPEG REQUIRED)
message("[libuhdr] JPEG_FOUND=${JPEG_FOUND}")
message("[libuhdr] JPEG_INCLUDE_DIRS=${JPEG_INCLUDE_DIRS}")
message("[libuhdr] JPEG_LIBRARIES=${JPEG_LIBRARIES}")
message("[libuhdr] JPEG_VERSION=${JPEG_VERSION}")

build_dependency_with_cmake(libuhdr
VERSION ${libuhdr_BUILD_VERSION}
GIT_REPOSITORY ${libuhdr_GIT_REPOSITORY}
Expand All @@ -22,7 +28,9 @@ build_dependency_with_cmake(libuhdr
-D CMAKE_INSTALL_LIBDIR=lib
-D CMAKE_POSITION_INDEPENDENT_CODE=ON
-D UHDR_BUILD_EXAMPLES=FALSE
-D UHDR_BUILD_DEPS=FALSE
-D UHDR_ENABLE_LOGS=TRUE
#-D JPEG_ROOT=${libjpeg-turbo_ROOT}
)

if (WIN32)
Expand Down
6 changes: 5 additions & 1 deletion src/jpeg.imageio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

if (libuhdr_FOUND)
set (UHDR_DEFS USE_UHDR)
else ()
set (LIBUHDR_INCLUDE_DIR "")
set (LIBUHDR_LIBRARY "")
set (UHDR_DEFS "")
endif ()

add_oiio_plugin (jpeginput.cpp jpegoutput.cpp
Expand All @@ -12,5 +16,5 @@ add_oiio_plugin (jpeginput.cpp jpegoutput.cpp
$<TARGET_NAME_IF_EXISTS:libjpeg-turbo::jpeg>
$<TARGET_NAME_IF_EXISTS:JPEG::JPEG>
${LIBUHDR_LIBRARY}
DEFINITIONS ${UHDR_DEFS}
DEFINITIONS "${UHDR_DEFS}"
)

0 comments on commit e138b9a

Please sign in to comment.