Skip to content

Commit

Permalink
add ZLIB to CMAKE target_link_libraries() as discussed in issue ampas…
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldsmith committed Jul 2, 2024
1 parent 70eccfb commit c4c51ec
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

# ZLIB is automatically added by OpenEXR 3.x but needs to be added for OpenEXR 2.x
find_package(ZLIB)
if(TARGET ZLIB::ZLIB)
message( STATUS "found ZLIB" )
message( STATUS " ZLIB_VERSION : ${ZLIB_VERSION}" )
message( STATUS " ZLIB_INCLUDE_DIRS : ${ZLIB_INCLUDE_DIRS}" )
message( STATUS " ZLIB_LIBRARIES : ${ZLIB_LIBRARIES}" )
message( STATUS " ZLIB_INCLUDE_DIR : ${ZLIB_INCLUDE_DIR}" )
message( STATUS " ZLIB_LIBRARY : ${ZLIB_LIBRARY}" )
endif()

find_package(OpenEXR 3 CONFIG QUIET)
if(OpenEXR_FOUND)
message(STATUS "Found OpenEXR ${OpenEXR_VERSION}")
Expand Down
2 changes: 2 additions & 0 deletions OpenEXR_CTL/exr_ctl_exr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ target_link_libraries (exr_ctl_exr
$<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
$<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
$<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
# ZLIB for OpenEXR 2.x:
$<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>
)
#target_link_libraries( exr_ctl_exr ${IlmBase_LIBRARIES} ${IlmBase_LDFLAGS_OTHER} )
#target_link_libraries( exr_ctl_exr ${OpenEXR_LIBRARIES} ${OpenEXR_LDFLAGS_OTHER} )
Expand Down
2 changes: 2 additions & 0 deletions OpenEXR_CTL/exrdpx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ target_link_libraries (exrdpx
$<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
$<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
$<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
# ZLIB for OpenEXR 2.x:
$<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>
)
#target_link_libraries( exrdpx ${IlmBase_LIBRARIES} ${IlmBase_LDFLAGS_OTHER} )
#target_link_libraries( exrdpx ${OpenEXR_LIBRARIES} ${OpenEXR_LDFLAGS_OTHER} )
Expand Down
2 changes: 2 additions & 0 deletions ctlrender/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ target_link_libraries(ctlrender
$<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
$<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
$<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
# ZLIB for OpenEXR 2.x:
$<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>
)

if( OpenEXR_FOUND )
Expand Down
2 changes: 2 additions & 0 deletions unittest/IlmImfCtl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ target_link_libraries( IlmImfCtlTest
$<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
$<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
$<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
# ZLIB for OpenEXR 2.x:
$<$<TARGET_EXISTS:ZLIB::ZLIB>:ZLIB::ZLIB>
)

add_test( IlmImfCtl IlmImfCtlTest )
Expand Down

0 comments on commit c4c51ec

Please sign in to comment.