From 8fb32c0a3908b6202ea895c865a08b55bbb49bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesi=C5=84ski?= Date: Sat, 15 Aug 2020 17:49:12 +0100 Subject: [PATCH] Work around fussy zlib on macOS --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6596f0107..096e14d59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()