Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/fontconfig/CONTROL
Original file line number Diff line number Diff line change
@@ -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
9 changes: 7 additions & 2 deletions ports/fontconfig/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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()
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)
46 changes: 46 additions & 0 deletions ports/fontconfig/vcpkg-cmake-wrapper.cmake.in
Original file line number Diff line number Diff line change
@@ -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()