Skip to content

Commit 1ab3298

Browse files
committed
build: ensure libuhdr build recipe points to correct JPEG package
Signed-off-by: loicvital <[email protected]>
1 parent 2a5fc74 commit 1ab3298

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

src/cmake/build_libuhdr.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ set (libuhdr_GIT_TAG "v${libuhdr_BUILD_VERSION}")
1313
set_cache (libuhdr_BUILD_SHARED_LIBS OFF
1414
DOC "Should execute a local libuhdr build, if necessary, build shared libraries" ADVANCED)
1515

16+
# CI debugging
17+
if (TARGET libjpeg-turbo::jpeg)
18+
get_target_property(JPEG_INCLUDE_DIRS JPEG::JPEG INTERFACE_INCLUDE_DIRECTORIES)
19+
get_target_property(JPEG_LIBRARIES JPEG::JPEG INTERFACE_LINK_LIBRARIES)
20+
endif ()
21+
set (MORE_UHDR_CMAKE_ARGS
22+
-D JPEG_INCLUDE_DIRS=${JPEG_INCLUDE_DIRS}
23+
-D JPEG_LIBRARIES=${JPEG_LIBRARIES}
24+
-D JPEG_FOUND=TRUE )
25+
message("[libuhdr] more uhdr cmake args: ${MORE_UHDR_CMAKE_ARGS}")
26+
1627
build_dependency_with_cmake(libuhdr
1728
VERSION ${libuhdr_BUILD_VERSION}
1829
GIT_REPOSITORY ${libuhdr_GIT_REPOSITORY}
@@ -22,7 +33,9 @@ build_dependency_with_cmake(libuhdr
2233
-D CMAKE_INSTALL_LIBDIR=lib
2334
-D CMAKE_POSITION_INDEPENDENT_CODE=ON
2435
-D UHDR_BUILD_EXAMPLES=FALSE
36+
-D UHDR_BUILD_DEPS=FALSE
2537
-D UHDR_ENABLE_LOGS=TRUE
38+
${MORE_UHDR_CMAKE_ARGS}
2639
)
2740

2841
if (WIN32)

src/cmake/externalpackages.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ else ()
8686
endif ()
8787

8888

89+
# Ultra HDR
90+
checked_find_package (libuhdr)
91+
92+
8993
checked_find_package (TIFF REQUIRED
9094
VERSION_MIN 4.0)
9195
alias_library_if_not_exists (TIFF::TIFF TIFF::tiff)
@@ -226,10 +230,6 @@ checked_find_package (fmt REQUIRED
226230
get_target_property(FMT_INCLUDE_DIR fmt::fmt-header-only INTERFACE_INCLUDE_DIRECTORIES)
227231

228232

229-
# Ultra HDR
230-
checked_find_package (libuhdr)
231-
232-
233233
###########################################################################
234234

235235
list (SORT CFP_ALL_BUILD_DEPS_FOUND COMPARE STRING CASE INSENSITIVE)

src/jpeg.imageio/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
if (libuhdr_FOUND)
66
set (UHDR_DEFS USE_UHDR)
7+
else ()
8+
set (LIBUHDR_INCLUDE_DIR "")
9+
set (LIBUHDR_LIBRARY "")
10+
set (UHDR_DEFS "")
711
endif ()
812

913
add_oiio_plugin (jpeginput.cpp jpegoutput.cpp
@@ -12,5 +16,5 @@ add_oiio_plugin (jpeginput.cpp jpegoutput.cpp
1216
$<TARGET_NAME_IF_EXISTS:libjpeg-turbo::jpeg>
1317
$<TARGET_NAME_IF_EXISTS:JPEG::JPEG>
1418
${LIBUHDR_LIBRARY}
15-
DEFINITIONS ${UHDR_DEFS}
19+
DEFINITIONS "${UHDR_DEFS}"
1620
)

0 commit comments

Comments
 (0)