-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
6 changed files
with
114 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 04ce73a..ee3cc05 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -454,7 +454,7 @@ endif () | ||
set(PKG_CONFIG_REQUIRED_PRIVATE "") | ||
|
||
if (ZLIB_FOUND) | ||
- target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES}) | ||
+ target_link_libraries(freetype PRIVATE ZLIB::ZLIB) | ||
target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS}) | ||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "zlib") | ||
endif () | ||
@@ -562,8 +562,15 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) | ||
install( | ||
EXPORT freetype-targets | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype | ||
- FILE freetype-config.cmake | ||
COMPONENT headers) | ||
+ | ||
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/freetype-config.cmake" | ||
+[[include(CMakeFindDependencyMacro) | ||
+find_dependency(ZLIB) | ||
+include("${CMAKE_CURRENT_LIST_DIR}/freetype-targets.cmake") | ||
+]]) | ||
+ | ||
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freetype-config.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype) | ||
endif () | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters