Skip to content

Commit 1946e4e

Browse files
committed
Add KDU
1 parent c29f0e5 commit 1946e4e

File tree

4 files changed

+508
-489
lines changed

4 files changed

+508
-489
lines changed

cmake/LibraryDefine.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ function(OPENEXR_DEFINE_LIBRARY libname)
1717
${OPENEXR_CURLIB_HEADERS}
1818
${OPENEXR_CURLIB_SOURCES})
1919

20+
# KDU
21+
if(KDU_LIBRARY)
22+
message("Using Kakadu SDK instead of OpenJPH")
23+
target_include_directories(${objlib} PRIVATE ${KDU_INCLUDE_DIR})
24+
target_compile_definitions(${objlib} PRIVATE KDU_AVAILABLE)
25+
target_link_libraries(${objlib} PUBLIC ${PROJECT_NAME}::Config ${OPENEXR_CURLIB_DEPENDENCIES} ${KDU_LIBRARY} ${CMAKE_DL_LIBS})
26+
else()
27+
target_link_libraries(${objlib} PUBLIC ${PROJECT_NAME}::Config ${OPENEXR_CURLIB_DEPENDENCIES} ${CMAKE_DL_LIBS} openjph)
28+
endif()
29+
2030
# Use ${OPENEXR_CXX_STANDARD} to determine the standard we use to compile
2131
# OpenEXR itself. The headers will use string_view and such, so ensure
2232
# the user is at least 17, but could be higher

cmake/OpenEXRSetup.cmake

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,22 @@ else()
252252
endif()
253253

254254

255+
#######################################
256+
# Get KDU
257+
#######################################
258+
259+
message(STATUS "Fetching KDU")
260+
find_path(KDU_INCLUDE_DIR kdu_args.h PATH_SUFFIXES kakadu kdu)
261+
find_library(KDU_LIBRARY NAMES kdu_a84R PATH_SUFFIXES kakadu kdu)
262+
263+
if(NOT(KDU_INCLUDE_DIR) OR NOT(KDU_LIBRARY))
264+
message("Kakadu SDK not found: ${KDU_LIBRARY} and ${KDU_INCLUDE_DIR}.")
265+
set(KDU_INCLUDE_DIR CACHE PATH "" FORCE)
266+
set(KDU_LIBRARY CACHE PATH "" FORCE)
267+
else()
268+
message("Kakadu SDK found: ${KDU_LIBRARY} and ${KDU_INCLUDE_DIR}.")
269+
endif()
270+
255271
#######################################
256272
# Find or download OpenJPH
257273
#######################################

0 commit comments

Comments
 (0)