Merge pull request #19797 from neheb/12
[feed/packages.git] / libs / libpng / patches / 020-cmake-zlib.patch
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
5
6 ZLIB_LIBRARIES and ZLIB_INCLUDE_DIRS are the official cmake variable
7 names.
8 ---
9 CMakeLists.txt | 15 ++++++++-------
10 1 file changed, 8 insertions(+), 7 deletions(-)
11
12 --- a/CMakeLists.txt
13 +++ b/CMakeLists.txt
14 @@ -40,7 +40,7 @@ option(PNG_BUILD_ZLIB "Custom zlib Locat
15
16 if(NOT PNG_BUILD_ZLIB)
17 find_package(ZLIB REQUIRED)
18 - include_directories(${ZLIB_INCLUDE_DIR})
19 + include_directories(${ZLIB_INCLUDE_DIRS})
20 endif()
21
22 if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
23 @@ -523,7 +523,7 @@ if(PNG_DEBUG)
24 endif()
25
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})
29
30 unset(PNG_LIB_TARGETS)
31
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")
35 endif()
36 - target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY})
37 + target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY})
38
39 if(UNIX AND AWK)
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")
44 endif()
45 - target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY})
46 + target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY})
47 endif()
48
49 if(PNG_FRAMEWORK)
50 @@ -589,7 +589,7 @@ if(PNG_FRAMEWORK)
51 XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
52 PUBLIC_HEADER "${libpng_public_hdrs}"
53 OUTPUT_NAME png)
54 - target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY})
55 + target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY})
56 endif()
57
58 if(NOT PNG_LIB_TARGETS)
59 @@ -754,7 +754,7 @@ if(PNG_SHARED AND PNG_EXECUTABLES)
60 set(PNG_BIN_TARGETS pngfix)
61
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)
66 endif()
67