Skip to content

Commit

Permalink
Set EXR_DEFLATE_LIB properly for static linking
Browse files Browse the repository at this point in the history
This leads OpenEXRCore/CMakeLists.txt to do:

    target_link_libraries(OpenEXRCore PUBLIC libdeflate)

instead of:

    target_link_libraries(OpenEXRCore PUBLIC PkgConfig::deflate)

which is not recognized. With a target link library of
`PkgConfig::deflate`, the static build of the OpenEXR libraries builds
successfully, but configuring an application against those static
libraries fails, saying it can't find `PkgConfig::deflate`.

Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm committed Sep 14, 2023
1 parent 7bdb932 commit 38ddb44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmake/OpenEXRSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ if(NOT OPENEXR_FORCE_INTERNAL_DEFLATE)
include(FindPkgConfig)
pkg_check_modules(deflate IMPORTED_TARGET GLOBAL libdeflate)
set(CMAKE_IGNORE_PATH)
if (deflate_FOUND)
message(STATUS "Using libdeflate from ${deflate_LINK_LIBRARIES}")
endif()
endif()

if(NOT TARGET PkgConfig::deflate AND NOT deflate_FOUND)
Expand Down Expand Up @@ -212,7 +215,8 @@ if(NOT TARGET PkgConfig::deflate AND NOT deflate_FOUND)
set(EXR_DEFLATE_LIB)
else()
set(EXR_DEFLATE_INCLUDE_DIR)
set(EXR_DEFLATE_LIB PkgConfig::deflate)
set(EXR_DEFLATE_LIB ${deflate_LIBRARIES})
# set(EXR_DEFLATE_LIB PkgConfig::deflate)
set(EXR_DEFLATE_SOURCES)
endif()

Expand Down

0 comments on commit 38ddb44

Please sign in to comment.