mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 06:47:50 +08:00
6b2f51fc7a
* [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>
47 lines
2.7 KiB
CMake
47 lines
2.7 KiB
CMake
_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()
|