Skip to content

Commit b053baa

Browse files
committed
get default mac build working with libpng + system libz.
without enable_all=on, png was getting mixed signals as it wasn't defining the prefix (as there was a system libz), but then not actually adding the system libz to the link line. result was unresolved zlib symbols. this tell png to turn off libz building, so it'll use the system libz, if our parent config has building zlib turned off.
1 parent 9d046fe commit b053baa

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

png/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ if (ENABLE_PNG)
3636
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX=ON>
3737
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX_STR=${Z_PREFIX_STR}>
3838
-DZLIB_ROOT=$<$<BOOL:${ZLIB_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
39+
$<$<BOOL:${ZLIB_TARGET}>:-DPNG_BUILD_ZLIB=OFF>
3940
-DPNG_LIB_NAME=${PNG_LIB_NAME}
4041
-DPNG_NO_DEBUG_POSTFIX=ON
4142
-DPNG_PREFIX=brl_

png/png.patch

+5-5
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ diff -Naur libpng/CMakeLists.txt PNG_BLD/CMakeLists.txt
138138
if(POLICY CMP0074)
139139
# Allow find_package() to use the ZLIB_ROOT variable, if available.
140140
cmake_policy(SET CMP0074 NEW)
141-
@@ -47,8 +50,10 @@
141+
@@ -48,8 +51,10 @@
142142
# Previously, we used to set CMAKE_DEBUG_POSTFIX globally. That variable should
143143
# not be cached, however, because doing so would affect all projects processed
144144
# after libpng, in unexpected and undesirable ways.
@@ -151,15 +151,15 @@ diff -Naur libpng/CMakeLists.txt PNG_BLD/CMakeLists.txt
151151

152152
# Allow the users to import their own extra configuration settings.
153153
set(DFA_XTRA ""
154-
@@ -97,6 +102,7 @@
154+
@@ -98,6 +103,7 @@
155155
option(PNG_BUILD_ZLIB "Custom zlib location, else find_package is used" OFF)
156156
if(NOT PNG_BUILD_ZLIB)
157157
find_package(ZLIB REQUIRED)
158158
+ include_directories(${ZLIB_INCLUDE_DIRS})
159159
elseif(POLICY CMP0074)
160160
if("x${ZLIB_ROOT}" STREQUAL "x")
161161
message(DEPRECATION
162-
@@ -489,10 +495,9 @@
162+
@@ -490,10 +496,9 @@
163163

164164
if(PNG_PREFIX)
165165
set(PNGLIBCONF_H_EXTRA_DEPENDS
@@ -172,7 +172,7 @@ diff -Naur libpng/CMakeLists.txt PNG_BLD/CMakeLists.txt
172172
endif()
173173

174174
generate_out(INPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
175-
@@ -676,15 +681,15 @@
175+
@@ -677,15 +682,15 @@
176176
# We are on a Unix or Unix-like toolchain like the GNU toolchain on Windows.
177177
# Library file names are expected to have an implicit prefix such as "lib".
178178
# Let CMake prepend and append its usual prefixes and suffixes by default.
@@ -192,7 +192,7 @@ diff -Naur libpng/CMakeLists.txt PNG_BLD/CMakeLists.txt
192192
endif()
193193

194194
if(PNG_SHARED)
195-
@@ -1067,16 +1072,16 @@
195+
@@ -1068,16 +1073,16 @@
196196
if(PNG_SHARED)
197197
# Create a symlink for libpng.dll.a => libpng16.dll.a on Cygwin
198198
if(NOT WIN32 OR CYGWIN OR MINGW)

0 commit comments

Comments
 (0)