From 7d74d8dc0938a8efbf6ec1b8988ea11632d32d91 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Thu, 15 Dec 2022 03:00:55 +0100 Subject: [PATCH] [freetype] Fix cmake usage (#28217) --- ports/freetype/brotli-static.patch | 8 +++++--- ports/freetype/portfile.cmake | 2 +- ports/freetype/usage | 4 ++++ ports/freetype/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/f-/freetype.json | 5 +++++ 6 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 ports/freetype/usage diff --git a/ports/freetype/brotli-static.patch b/ports/freetype/brotli-static.patch index 6d657aa5a3..14a03f085a 100644 --- a/ports/freetype/brotli-static.patch +++ b/ports/freetype/brotli-static.patch @@ -2,7 +2,7 @@ diff --git a/builds/cmake/FindBrotliDec.cmake b/builds/cmake/FindBrotliDec.cmake index 46356b1fd..ed4cc2409 100644 --- a/builds/cmake/FindBrotliDec.cmake +++ b/builds/cmake/FindBrotliDec.cmake -@@ -35,10 +35,17 @@ find_path(BROTLIDEC_INCLUDE_DIRS +@@ -35,10 +35,19 @@ find_path(BROTLIDEC_INCLUDE_DIRS PATH_SUFFIXES brotli) find_library(BROTLIDEC_LIBRARIES @@ -11,13 +11,15 @@ index 46356b1fd..ed4cc2409 100644 HINTS ${PC_BROTLIDEC_LIBDIR} ${PC_BROTLIDEC_LIBRARY_DIRS}) -+if(BROTLIDEC_LIBRARIES MATCHES "-static") ++get_filename_component(z_vcpkg_freetype_brotlidec_name "${BROTLIDEC_LIBRARIES}" NAME) ++if(z_vcpkg_freetype_brotlidec_name MATCHES "-static") + find_library(BROTLICOMMON_LIBRARIES + NAMES brotlicommon-static + HINTS ${PC_BROTLIDEC_LIBDIR} + ${PC_BROTLIDEC_LIBRARY_DIRS}) -+ set(BROTLIDEC_LIBRARIES ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES}) ++ set(BROTLIDEC_LIBRARIES "${BROTLIDEC_LIBRARIES};${BROTLICOMMON_LIBRARIES}") +endif() ++unset(z_vcpkg_freetype_brotlidec_name) include(FindPackageHandleStandardArgs) find_package_handle_standard_args( diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index f43790ddb1..0639955c01 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -76,7 +76,7 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) - +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") vcpkg_install_copyright( FILE_LIST "${SOURCE_PATH}/LICENSE.TXT" diff --git a/ports/freetype/usage b/ports/freetype/usage new file mode 100644 index 0000000000..ca71e4443b --- /dev/null +++ b/ports/freetype/usage @@ -0,0 +1,4 @@ +freetype is compatible with built-in CMake targets: + + find_package(Freetype REQUIRED) + target_link_libraries(main PRIVATE Freetype::Freetype) # since CMake 3.10 diff --git a/ports/freetype/vcpkg.json b/ports/freetype/vcpkg.json index b129d8715b..42639756f9 100644 --- a/ports/freetype/vcpkg.json +++ b/ports/freetype/vcpkg.json @@ -1,7 +1,7 @@ { "name": "freetype", "version": "2.12.1", - "port-version": 2, + "port-version": 3, "description": "A library to render fonts.", "homepage": "https://www.freetype.org/", "license": "FTL OR GPL-2.0-or-later", diff --git a/versions/baseline.json b/versions/baseline.json index 175e49742e..0fca1be7b8 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2458,7 +2458,7 @@ }, "freetype": { "baseline": "2.12.1", - "port-version": 2 + "port-version": 3 }, "freetype-gl": { "baseline": "2022-01-17", diff --git a/versions/f-/freetype.json b/versions/f-/freetype.json index 1c7ad157ca..77d3ed64ce 100644 --- a/versions/f-/freetype.json +++ b/versions/f-/freetype.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "db92ea87ff12339808263710675221df6a06ac15", + "version": "2.12.1", + "port-version": 3 + }, { "git-tree": "f1d6772ea2cb8cd74146b263b5dab534a10dd641", "version": "2.12.1",