vcpkg/ports/libpng/cmake.patch
Kai Pastor 7cd3196145
[libpng] Fix and cleanup (#24211)
* Fix unused CMake variable warning

* Acquire msys only on Windows

* Revise APNG variable names and usage

* Fix download mode usability with APNG

* Uncompress APNG patch with gzip

gzip is a default package of MSYS2 and (most) other systems.
7z download is implemented for windows only.

* Revise main CMake patches

cmake.patch deals with libpng build configuration.
fix-export-targets deals with cmake config export.

* Revise pkgconfig patching and fixup

* Additional cleanup

* Add usage based on FindPNG.cmake

* Update versions

Co-authored-by: Leonid Pospelov <pospelovlm@yandex.ru>
2022-04-18 14:33:43 -07:00

28 lines
877 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a8e5100..0ccac52 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,11 +40,11 @@ option(PNG_BUILD_ZLIB "Custom zlib Location, else find_package is used" OFF)
if(NOT PNG_BUILD_ZLIB)
find_package(ZLIB REQUIRED)
- include_directories(${ZLIB_INCLUDE_DIR})
+ set(ZLIB_LIBRARY ZLIB::ZLIB)
endif()
if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
- find_library(M_LIBRARY m)
+ set(M_LIBRARY m)
else()
# libm is not needed and/or not available
set(M_LIBRARY "")
@@ -557,7 +557,7 @@ if(PNG_STATIC)
# MSVC doesn't use a different file extension for shared vs. static
# libs. We are able to change OUTPUT_NAME to remove the _static
# for all other platforms.
- if(NOT MSVC)
+ if(1)
set_target_properties(png_static PROPERTIES
OUTPUT_NAME "${PNG_LIB_NAME}"
CLEAN_DIRECT_OUTPUT 1)