aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Neumann <30894796+Neumann-A@users.noreply.github.com>2021-01-11 09:27:46 +0100
committerGitHub <noreply@github.com>2021-01-11 00:27:46 -0800
commit6b2f51fc7aa3c8123e591a7726bb0946ba7dbf79 (patch)
treeb1b16e2714feae3bdc3987034044523494193935
parent13293851e32e78e85782e8e8aa8ebee338c500f4 (diff)
downloadvcpkg-6b2f51fc7aa3c8123e591a7726bb0946ba7dbf79.tar.gz
vcpkg-6b2f51fc7aa3c8123e591a7726bb0946ba7dbf79.zip
[fontconfig] add vcpkg cmake wrapper. (#15144)
* [fontconfig] add vcpkg cmake wrapper. * fix empty statement in the wrapper * dont depend on Freetype::Freetype if it is unavailable * rename wrapper to cmake.in * Update ports/fontconfig/portfile.cmake Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com> Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com>
-rw-r--r--ports/fontconfig/CONTROL2
-rw-r--r--ports/fontconfig/portfile.cmake9
-rw-r--r--ports/fontconfig/vcpkg-cmake-wrapper.cmake.in46
3 files changed, 54 insertions, 3 deletions
diff --git a/ports/fontconfig/CONTROL b/ports/fontconfig/CONTROL
index d02960b62..4b455e985 100644
--- a/ports/fontconfig/CONTROL
+++ b/ports/fontconfig/CONTROL
@@ -1,6 +1,6 @@
Source: fontconfig
Version: 2.13.1
-Port-Version: 2
+Port-Version: 3
Homepage: https://www.freedesktop.org/software/fontconfig/front.html
Description: Library for configuring and customizing font access.
Build-Depends: freetype, expat, libiconv, dirent, pthread, json-c, dirent, libuuid (!windows&!osx), gettext \ No newline at end of file
diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake
index cf840dd12..d50ff6392 100644
--- a/ports/fontconfig/portfile.cmake
+++ b/ports/fontconfig/portfile.cmake
@@ -45,7 +45,7 @@ vcpkg_configure_make(
vcpkg_install_make(ADD_BIN_TO_PATH)
vcpkg_copy_pdbs()
-vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES uuid)
+vcpkg_fixup_pkgconfig()
# Fix paths in debug pc file.
set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/fontconfig.pc")
@@ -98,4 +98,9 @@ endif()
if(VCPKG_TARGET_IS_WINDOWS)
# Unnecessary make rule creating the fontconfig cache dir on windows.
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}LOCAL_APPDATA_FONTCONFIG_CACHE")
-endif() \ No newline at end of file
+endif()
+
+if(NOT VCPKG_TARGET_IS_LINUX)
+ set(VCPKG_TARGET_IS_LINUX 0) # To not leave empty AND statements in the wrapper
+endif()
+configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
diff --git a/ports/fontconfig/vcpkg-cmake-wrapper.cmake.in b/ports/fontconfig/vcpkg-cmake-wrapper.cmake.in
new file mode 100644
index 000000000..ab2b5679b
--- /dev/null
+++ b/ports/fontconfig/vcpkg-cmake-wrapper.cmake.in
@@ -0,0 +1,46 @@
+_find_package(${ARGS})
+if(Fontconfig_FOUND) # theoretically this could be skipped. If the wrapper is installed it should be found!
+ find_package(Freetype)
+ if(Freetype_FOUND AND TARGET Fontconfig::Fontconfig)
+ if(TARGET Freetype::Freetype)
+ set_property(TARGET Fontconfig::Fontconfig APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Freetype::Freetype")
+ else()
+ # TODO link Freetype libraries to the target if the target Freetype::Freetype is not defined;
+ endif()
+ endif()
+ if(FREETYPE_LIBRARIES)
+ list(APPEND Fontconfig_LIBRARIES "${FREETYPE_LIBRARIES}")
+ endif()
+ find_package(EXPAT)
+ if(EXPAT_FOUND AND TARGET Fontconfig::Fontconfig)
+ set_property(TARGET Fontconfig::Fontconfig APPEND PROPERTY INTERFACE_LINK_LIBRARIES "EXPAT::EXPAT")
+ endif()
+ if(EXPAT_LIBRARIES)
+ list(APPEND Fontconfig_LIBRARIES "${EXPAT_LIBRARIES}")
+ endif()
+ include(SelectLibraryConfigurations)
+ find_library(Fontconfig_LIBRARY_DEBUG NAMES fontconfig fontconfigd NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_INSTALLED_DIR}/debug" NO_DEFAULT_PATH)
+ find_library(Fontconfig_LIBRARY_RELEASE NAMES fontconfig NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH)
+ select_library_configurations(Fontconfig)
+ if(@VCPKG_TARGET_IS_LINUX@)
+ find_library(UUID_LIBRARY_DEBUG NAMES uuid uuidd uuid_d NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_INSTALLED_DIR}/debug" NO_DEFAULT_PATH)
+ find_library(UUID_LIBRARY_RELEASE NAMES uuid NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH)
+ select_library_configurations(UUID)
+ endif()
+ if(Fontconfig_LIBRARY_DEBUG AND TARGET Fontconfig::Fontconfig)
+ set_target_properties(Fontconfig::Fontconfig PROPERTIES IMPORTED_LOCATION_DEBUG "${Fontconfig_LIBRARY_DEBUG}")
+ if(UUID_LIBRARY_DEBUG AND @VCPKG_TARGET_IS_LINUX@)
+ set_property(TARGET Fontconfig::Fontconfig APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<$<CONFIG:DEBUG>:${UUID_LIBRARY_DEBUG}>")
+ endif()
+ endif()
+ if(Fontconfig_LIBRARY_RELEASE AND TARGET Fontconfig::Fontconfig)
+ set_target_properties(Fontconfig::Fontconfig PROPERTIES IMPORTED_LOCATION_RELEASE "${Fontconfig_LIBRARY_RELEASE}")
+ if(UUID_LIBRARY_RELEASE AND @VCPKG_TARGET_IS_LINUX@)
+ set_property(TARGET Fontconfig::Fontconfig APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:DEBUG>>:${UUID_LIBRARY_RELEASE}>")
+ endif()
+ endif()
+
+ if(UUID_LIBRARIES AND @VCPKG_TARGET_IS_LINUX@)
+ list(APPEND Fontconfig_LIBRARIES "${UUID_LIBRARIES}")
+ endif()
+endif()