1 From 9f734b13f4ea062af98652c4c7678f667d2d85c7 Mon Sep 17 00:00:00 2001
2 From: David Callu <callu.david@gmail.com>
3 Date: Thu, 4 Jul 2019 15:15:53 +0200
4 Subject: [PATCH] cmake: Use the correct ZLIB_* variable names
6 ZLIB_LIBRARIES and ZLIB_INCLUDE_DIRS are the official cmake variable
9 CMakeLists.txt | 15 ++++++++-------
10 1 file changed, 8 insertions(+), 7 deletions(-)
14 @@ -40,7 +40,7 @@ option(PNG_BUILD_ZLIB "Custom zlib Locat
16 if(NOT PNG_BUILD_ZLIB)
17 find_package(ZLIB REQUIRED)
18 - include_directories(${ZLIB_INCLUDE_DIR})
19 + include_directories(${ZLIB_INCLUDE_DIRS})
22 if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
23 @@ -523,7 +523,7 @@ if(PNG_DEBUG)
26 # NOW BUILD OUR TARGET
27 -include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
28 +include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS})
30 unset(PNG_LIB_TARGETS)
32 @@ -537,7 +537,7 @@ if(PNG_SHARED)
33 set_target_properties(png PROPERTIES PREFIX "lib")
34 set_target_properties(png PROPERTIES IMPORT_PREFIX "lib")
36 - target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY})
37 + target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY})
40 if(HAVE_LD_VERSION_SCRIPT)
41 @@ -572,7 +572,7 @@ if(PNG_STATIC)
42 # msvc does not append 'lib' - do it here to have consistent name
43 set_target_properties(png_static PROPERTIES PREFIX "lib")
45 - target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY})
46 + target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY})
50 @@ -589,7 +589,7 @@ if(PNG_FRAMEWORK)
51 XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
52 PUBLIC_HEADER "${libpng_public_hdrs}"
54 - target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY})
55 + target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY})
58 if(NOT PNG_LIB_TARGETS)
59 @@ -754,7 +754,7 @@ if(PNG_SHARED AND PNG_EXECUTABLES)
60 set(PNG_BIN_TARGETS pngfix)
62 add_executable(png-fix-itxt ${png_fix_itxt_sources})
63 - target_link_libraries(png-fix-itxt ${ZLIB_LIBRARY} ${M_LIBRARY})
64 + target_link_libraries(png-fix-itxt ${ZLIB_LIBRARIES} ${M_LIBRARY})
65 list(APPEND PNG_BIN_TARGETS png-fix-itxt)