Skip to content

Commit

Permalink
Work around fussy zlib on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Aug 15, 2020
1 parent b3e7390 commit 8fb32c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,14 @@ if(ENABLE_STATIC)
endif()

if(PNG_SUPPORTED)
if (APPLE)
find_package(ZLIB REQUIRED) # macos doesn't have static zlib
endif()
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
find_package(PNG 1.6 REQUIRED)
find_package(ZLIB REQUIRED)
if (NOT APPLE)
find_package(ZLIB REQUIRED)
endif()
target_include_directories(cjpeg-static PUBLIC ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
target_link_libraries(cjpeg-static ${PNG_LIBRARY} ${ZLIB_LIBRARY})
endif()
Expand Down

0 comments on commit 8fb32c0

Please sign in to comment.