Skip to content

Commit

Permalink
Only find_package ZLIB when required
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmallon authored and cary-ilm committed Jun 25, 2019
1 parent db9fcdc commit ab357b0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ project(OpenEXR VERSION ${OPENEXR_VERSION})
include(OpenEXRSettings)

# Packages
find_package(ZLIB)
if(OPENEXR_BUILD_OPENEXR AND NOT ZLIB_FOUND)
message(WARNING "Make Zlib available to CMake's search path, and re-run configuration")
message(FATAL_ERROR "Zlib is a required dependency when OPENEXR_BUILD_OPENEXR is set")
if(OPENEXR_BUILD_OPENEXR OR OPENEXR_BUILD_VIEWERS)
find_package(ZLIB)
if(NOT ZLIB_FOUND)
message(WARNING "Make Zlib available to CMake's search path, and re-run configuration")
message(FATAL_ERROR "Zlib is a required dependency when OPENEXR_BUILD_OPENEXR or OPENEXR_BUILD_VIEWERS is set")
endif()
endif()

if (OPENEXR_BUILD_PYTHON_LIBS)
Expand Down

0 comments on commit ab357b0

Please sign in to comment.