@@ -305,14 +305,13 @@ endif()
305305message (STATUS "Locating OpenJPH" )
306306
307307option (OPENEXR_OJPH_USE_FINDPACKAGE "Use find_package instead of downloading OpenJPH from a git repo" OFF )
308- set (OPENEXR_OJPH_REPO "https://github.com/aous72 /OpenJPH.git" CACHE STRING "OpenJPH Git repo URI" )
309- set (OPENEXR_OJPH_TAG "supporting_differing_components " CACHE STRING "OpenJPH Git repo tag" )
308+ set (OPENEXR_OJPH_REPO "https://github.com/palemieux /OpenJPH.git" CACHE STRING "OpenJPH Git repo URI" )
309+ set (OPENEXR_OJPH_TAG "add-export " CACHE STRING "OpenJPH Git repo tag" )
310310
311311if (NOT (OPENJPH_INCLUDE_DIRS AND OPENJPH_LIBRARIES))
312312 if (OPENEXR_OJPH_USE_FINDPACKAGE)
313- find_package (openjph 0.19)
314-
315- message (STATUS "Using OpenJPH at ${OPENJPH_LIBRARIES} ." )
313+ find_package (openjph 0.19 REQUIRED)
314+ message (STATUS "Found OpenJPH locally." )
316315 else ()
317316 include (FetchContent)
318317 FetchContent_Declare(
@@ -326,29 +325,18 @@ if (NOT (OPENJPH_INCLUDE_DIRS AND OPENJPH_LIBRARIES))
326325 set (OJPH_BUILD_EXECUTABLES OFF CACHE BOOL "" FORCE)
327326 FetchContent_MakeAvailable(openjph)
328327 install (
329- TARGETS openjph
330- EXPORT ${PROJECT_NAME}
331- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
332- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
333- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
334- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
335- PUBLIC_HEADER
336- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} /${OPENEXR_OUTPUT_SUBDIR}
328+ TARGETS openjph
329+ EXPORT ${PROJECT_NAME}
337330 )
338331 set_target_properties (openjph PROPERTIES
339332 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /bin"
340333 )
341-
342- set (OPENJPH_INCLUDE_DIRS "${openjph_SOURCE_DIR} /src/core/common" )
343- set (OPENJPH_LIBRARIES openjph)
334+ include_directories ("${openjph_SOURCE_DIR} /src/core/common" )
344335
345336 message (STATUS "Building OpenJPH from ${OPENEXR_OJPH_REPO} ." )
346337 endif ()
347338endif ()
348339
349- if (NOT (OPENJPH_INCLUDE_DIRS AND OPENJPH_LIBRARIES))
350- message (SEND_ERROR "OpenJPH could not be found." )
351- endif ()
352340
353341#######################################
354342# Find or install Imath
0 commit comments