mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
libpng: properly fix zlib issue
The previous commit meant to avoid adding an LDFLAG but it just avoided the issue. The real issue is PNG_BUILD_ZLIB being turned to ON. This variable is for specifying a custom zlib location, which is not necessary. Switching it to OFF calls find_package and links properly. Backported two zlib related patches. The latter is a somewhat impoarant fix. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
From 9f734b13f4ea062af98652c4c7678f667d2d85c7 Mon Sep 17 00:00:00 2001
|
||||
From: David Callu <callu.david@gmail.com>
|
||||
Date: Thu, 4 Jul 2019 15:15:53 +0200
|
||||
Subject: [PATCH] cmake: Use the correct ZLIB_* variable names
|
||||
|
||||
ZLIB_LIBRARIES and ZLIB_INCLUDE_DIRS are the official cmake variable
|
||||
names.
|
||||
---
|
||||
CMakeLists.txt | 15 ++++++++-------
|
||||
1 file changed, 8 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -40,7 +40,7 @@ option(PNG_BUILD_ZLIB "Custom zlib Locat
|
||||
|
||||
if(NOT PNG_BUILD_ZLIB)
|
||||
find_package(ZLIB REQUIRED)
|
||||
- include_directories(${ZLIB_INCLUDE_DIR})
|
||||
+ include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
|
||||
@@ -523,7 +523,7 @@ if(PNG_DEBUG)
|
||||
endif()
|
||||
|
||||
# NOW BUILD OUR TARGET
|
||||
-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
|
||||
+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIRS})
|
||||
|
||||
unset(PNG_LIB_TARGETS)
|
||||
|
||||
@@ -537,7 +537,7 @@ if(PNG_SHARED)
|
||||
set_target_properties(png PROPERTIES PREFIX "lib")
|
||||
set_target_properties(png PROPERTIES IMPORT_PREFIX "lib")
|
||||
endif()
|
||||
- target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
+ target_link_libraries(png ${ZLIB_LIBRARIES} ${M_LIBRARY})
|
||||
|
||||
if(UNIX AND AWK)
|
||||
if(HAVE_LD_VERSION_SCRIPT)
|
||||
@@ -572,7 +572,7 @@ if(PNG_STATIC)
|
||||
# msvc does not append 'lib' - do it here to have consistent name
|
||||
set_target_properties(png_static PROPERTIES PREFIX "lib")
|
||||
endif()
|
||||
- target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
+ target_link_libraries(png_static ${ZLIB_LIBRARIES} ${M_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(PNG_FRAMEWORK)
|
||||
@@ -589,7 +589,7 @@ if(PNG_FRAMEWORK)
|
||||
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
||||
PUBLIC_HEADER "${libpng_public_hdrs}"
|
||||
OUTPUT_NAME png)
|
||||
- target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
+ target_link_libraries(png_framework ${ZLIB_LIBRARIES} ${M_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(NOT PNG_LIB_TARGETS)
|
||||
@@ -754,7 +754,7 @@ if(PNG_SHARED AND PNG_EXECUTABLES)
|
||||
set(PNG_BIN_TARGETS pngfix)
|
||||
|
||||
add_executable(png-fix-itxt ${png_fix_itxt_sources})
|
||||
- target_link_libraries(png-fix-itxt ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
+ target_link_libraries(png-fix-itxt ${ZLIB_LIBRARIES} ${M_LIBRARY})
|
||||
list(APPEND PNG_BIN_TARGETS png-fix-itxt)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user