Skip to content

Commit

Permalink
Added RAWReader to tlRender and fixed build.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Sep 22, 2023
1 parent 1bda93c commit e7d3c08
Show file tree
Hide file tree
Showing 7 changed files with 936 additions and 151 deletions.
18 changes: 13 additions & 5 deletions cmake/Modules/FindLibRaw.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# * LibRaw

find_package(ZLIB REQUIRED)
find_package(OpenMP REQUIRED)
find_package(OpenMP)
find_package(LCMS2)

find_path(LibRaw_INCLUDE_DIR NAMES libraw/libraw.h)
Expand All @@ -24,9 +24,9 @@ set(LibRaw_INCLUDE_DIRS

if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
find_library(LibRaw_LIBRARY
NAMES raw)
NAMES rawd raw)
find_library(LibRaw_r_LIBRARY
NAMES raw_r)
NAMES raw_rd raw_r)
else()
find_library(LibRaw_LIBRARY
NAMES raw)
Expand All @@ -43,21 +43,29 @@ find_package_handle_standard_args(
REQUIRED_VARS LibRaw_INCLUDE_DIR LibRaw_LIBRARY)
mark_as_advanced(LibRaw_INCLUDE_DIR LibRaw_LIBRARY)

set(LibRaw_LINK_LIBRARIES ZLIB)
if(LCMS2_FOUND)
list(APPEND LibRaw_LINK_LIBRARIES LCMS2)
endif()
if(OpenMP_FOUND)
list(APPEND LibRaw_LINK_LIBRARIES OpenMP::OpenMP_CXX)
endif()

if(LibRaw_FOUND AND NOT TARGET LibRaw::libraw)
add_library(LibRaw::libraw UNKNOWN IMPORTED)
set_target_properties(LibRaw::libraw PROPERTIES
IMPORTED_LOCATION "${LibRaw_LIBRARY}"
INTERFACE_COMPILE_DEFINITIONS LibRaw_FOUND
INTERFACE_INCLUDE_DIRECTORIES "${LibRaw_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "ZLIB;LCMS2;OpenMP::OpenMP_CXX")
INTERFACE_LINK_LIBRARIES "${LibRaw_LINK_LIBRARIES}")
endif()
if(LibRaw_FOUND AND NOT TARGET LibRaw::libraw_r)
add_library(LibRaw::libraw_r UNKNOWN IMPORTED)
set_target_properties(LibRaw::libraw_r PROPERTIES
IMPORTED_LOCATION "${LibRaw_r_LIBRARY}"
INTERFACE_COMPILE_DEFINITIONS LibRaw_FOUND
INTERFACE_INCLUDE_DIRECTORIES "${LibRaw_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "ZLIB;LCMS2;OpenMP::OpenMP_CXX")
INTERFACE_LINK_LIBRARIES "${LibRaw_LINK_LIBRARIES}")
endif()
if(LibRaw_FOUND AND NOT TARGET LibRaw)
add_library(LibRaw INTERFACE)
Expand Down
Loading

0 comments on commit e7d3c08

Please sign in to comment.