diff options
| author | Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> | 2020-11-12 14:25:03 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-12 14:25:03 -0800 |
| commit | f50c0eae60fb1391d610451289e877784228eb18 (patch) | |
| tree | 8c6bce21814cb278599b59db64b0966a1bfb4715 /ports/libpng/fix-export-targets.patch | |
| parent | 2f847cedfa76ccb1ce7ca69974af13088f3054ba (diff) | |
| download | vcpkg-f50c0eae60fb1391d610451289e877784228eb18.tar.gz vcpkg-f50c0eae60fb1391d610451289e877784228eb18.zip | |
[freetype] Fix INTERFACE_LINK_LIBRARIES in exported cmake file (#14499)
* [freetype] Fix INTERFACE_LINK_LIBRARIES in exported cmake file
* [freetype] Bump version
* [libpng] Fix dependency zlib in INTERFACE_LINK_LIBRARIES
* [freetype] Revert changes about keyword PUBLIC and pkgconfig
Diffstat (limited to 'ports/libpng/fix-export-targets.patch')
| -rw-r--r-- | ports/libpng/fix-export-targets.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/ports/libpng/fix-export-targets.patch b/ports/libpng/fix-export-targets.patch new file mode 100644 index 000000000..ec331c48d --- /dev/null +++ b/ports/libpng/fix-export-targets.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b45e878..19f8692 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -536,7 +536,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::ZLIB ${M_LIBRARY}) + + if(UNIX AND AWK) + if(HAVE_LD_VERSION_SCRIPT) +@@ -564,7 +564,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::ZLIB ${M_LIBRARY}) + endif() + + if(PNG_FRAMEWORK) +@@ -581,7 +581,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::ZLIB ${M_LIBRARY}) + endif() + + if(NOT PNG_LIB_TARGETS) +@@ -746,7 +746,7 @@ if(PNG_SHARED) + 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::ZLIB ${M_LIBRARY}) + list(APPEND PNG_BIN_TARGETS png-fix-itxt) + endif() + +@@ -851,7 +851,7 @@ endif() + # INSTALL + if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) + install(TARGETS ${PNG_LIB_TARGETS} +- EXPORT libpng ++ EXPORT libpng-targets + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +@@ -919,7 +919,14 @@ endif() + + # Create an export file that CMake users can include() to import our targets. + if(NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL) +- install(EXPORT libpng DESTINATION lib/libpng FILE libpngConfig.cmake) ++ install(EXPORT libpng-targets DESTINATION lib/libpng) ++ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libpng-config.cmake" ++ [[include(CMakeFindDependencyMacro) ++find_dependency(ZLIB) ++include("${CMAKE_CURRENT_LIST_DIR}/libpng-targets.cmake") ++ ]]) ++ ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng-config.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/libpng) + endif() + + # what's with libpng-manual.txt and all the extra files? |
