mirror of https://github.com/microsoft/vcpkg.git
[cairo] Make freetype and fontconfig optional. (#15965)
* [cairo] Make fontconfig optional. * [cairo] Update port versions
This commit is contained in:
parent
9adaafc4f4
commit
323a0a387a
|
|
@ -156,10 +156,13 @@ file(GLOB SOURCES
|
|||
"cairo-svg-surface.c"
|
||||
# script surface
|
||||
"cairo-script-surface.c"
|
||||
# fontconfig + freetype
|
||||
"cairo-ft-font.c"
|
||||
)
|
||||
|
||||
if(WITH_FREETYPE)
|
||||
file(GLOB _FREETYPE_SOURCES "cairo-ft-font.c")
|
||||
list(APPEND SOURCES ${_FREETYPE_SOURCES})
|
||||
endif()
|
||||
|
||||
# win32
|
||||
file(GLOB PLATFORM_SOURCES_WIN32
|
||||
"win32/cairo-win32-debug.c"
|
||||
|
|
@ -181,17 +184,21 @@ set(CMAKE_DEBUG_POSTFIX "d")
|
|||
find_package(Threads REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(PNG REQUIRED)
|
||||
find_package(Freetype REQUIRED)
|
||||
find_package(Fontconfig REQUIRED)
|
||||
if(WITH_FREETYPE)
|
||||
find_package(Freetype REQUIRED)
|
||||
find_package(Fontconfig REQUIRED)
|
||||
endif()
|
||||
find_package(unofficial-pixman CONFIG REQUIRED)
|
||||
|
||||
# Cairo needs to be told which features of FreeType are availible
|
||||
add_definitions(
|
||||
-DHAVE_FT_GLYPHSLOT_EMBOLDEN=1
|
||||
-DHAVE_FT_LIBRARY_SETLCDFILTER=1
|
||||
-DHAVE_FT_GLYPHSLOT_OBLIQUE=1
|
||||
-DHAVE_FT_LOAD_SFNT_TABLE=1
|
||||
-DHAVE_FT_GET_X11_FONT_FORMAT=1)
|
||||
if(WITH_FREETYPE)
|
||||
add_definitions(
|
||||
-DHAVE_FT_GLYPHSLOT_EMBOLDEN=1
|
||||
-DHAVE_FT_LIBRARY_SETLCDFILTER=1
|
||||
-DHAVE_FT_GLYPHSLOT_OBLIQUE=1
|
||||
-DHAVE_FT_LOAD_SFNT_TABLE=1
|
||||
-DHAVE_FT_GET_X11_FONT_FORMAT=1)
|
||||
endif()
|
||||
|
||||
# additional features for macOS
|
||||
if(UNIX OR APPLE)
|
||||
|
|
@ -210,8 +217,11 @@ add_library(cairo ${SOURCES})
|
|||
if (WITH_X11)
|
||||
target_compile_definitions(cairo PUBLIC -DCAIRO_HAS_XLIB_SURFACE=1)
|
||||
endif()
|
||||
target_include_directories(cairo PUBLIC ${FREETYPE_INCLUDE_DIRS})
|
||||
target_link_libraries(cairo PRIVATE ZLIB::ZLIB PNG::PNG Freetype::Freetype unofficial::pixman::pixman-1 Fontconfig::Fontconfig)
|
||||
if(WITH_FREETYPE)
|
||||
target_include_directories(cairo PUBLIC ${FREETYPE_INCLUDE_DIRS})
|
||||
target_link_libraries(cairo PRIVATE Freetype::Freetype Fontconfig::Fontconfig)
|
||||
endif()
|
||||
target_link_libraries(cairo PRIVATE ZLIB::ZLIB PNG::PNG unofficial::pixman::pixman-1)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(cairo PRIVATE gdi32 msimg32 user32)
|
||||
|
|
@ -292,14 +302,16 @@ install(
|
|||
DESTINATION share/unofficial-cairo
|
||||
)
|
||||
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unofficial-cairo-config.cmake "
|
||||
include(CMakeFindDependencyMacro)
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unofficial-cairo-config.cmake
|
||||
"include(CMakeFindDependencyMacro)
|
||||
find_dependency(ZLIB)
|
||||
find_dependency(PNG)
|
||||
find_dependency(Freetype)
|
||||
find_dependency(Fontconfig)
|
||||
if(${WITH_FREETYPE})
|
||||
find_dependency(Freetype)
|
||||
find_dependency(Fontconfig)
|
||||
endif()
|
||||
find_dependency(unofficial-pixman CONFIG)
|
||||
if(WITH_GOBJECT)
|
||||
if(${WITH_GOBJECT})
|
||||
find_dependency(unofficial-glib CONFIG)
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
Source: cairo
|
||||
Version: 1.16.0
|
||||
Port-Version: 8
|
||||
Homepage: https://cairographics.org
|
||||
Description: Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.
|
||||
Build-Depends: zlib, libpng, pixman, freetype, fontconfig
|
||||
|
||||
Feature: x11
|
||||
Description: build with x11 support
|
||||
|
||||
Feature: gobject
|
||||
Description: build gobject module
|
||||
Build-Depends: glib
|
||||
|
|
@ -30,9 +30,9 @@
|
|||
#define CAIRO_HAS_GOBJECT_FUNCTIONS 1
|
||||
|
||||
/* Require FreeType */
|
||||
#define CAIRO_HAS_FT_FONT 1
|
||||
#cmakedefine01 CAIRO_HAS_FT_FONT
|
||||
|
||||
/* Require FontConfig */
|
||||
#define CAIRO_HAS_FC_FONT 1
|
||||
#cmakedefine01 CAIRO_HAS_FC_FONT
|
||||
|
||||
#endif
|
||||
|
|
@ -15,7 +15,12 @@ vcpkg_extract_source_archive_ex(
|
|||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/src)
|
||||
file(COPY ${CURRENT_PORT_DIR}/cairo-features.h DESTINATION ${SOURCE_PATH}/src)
|
||||
|
||||
if("freetype" IN_LIST FEATURES)
|
||||
set(CAIRO_HAS_FT_FONT TRUE)
|
||||
set(CAIRO_HAS_FC_FONT TRUE)
|
||||
endif()
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/cairo-features.h.in" "${SOURCE_PATH}/src/cairo-features.h")
|
||||
|
||||
if ("x11" IN_LIST FEATURES)
|
||||
if (VCPKG_TARGET_IS_WINDOWS)
|
||||
|
|
@ -33,6 +38,7 @@ endif()
|
|||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
x11 WITH_X11
|
||||
gobject WITH_GOBJECT
|
||||
freetype WITH_FREETYPE
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"name": "cairo",
|
||||
"version-string": "1.16.0",
|
||||
"port-version": 9,
|
||||
"description": "Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.",
|
||||
"homepage": "https://cairographics.org",
|
||||
"dependencies": [
|
||||
"libpng",
|
||||
"pixman",
|
||||
"zlib"
|
||||
],
|
||||
"default-features": [
|
||||
"freetype"
|
||||
],
|
||||
"features": {
|
||||
"freetype": {
|
||||
"description": "use the freetype font backend",
|
||||
"dependencies": [
|
||||
"fontconfig",
|
||||
"freetype"
|
||||
]
|
||||
},
|
||||
"gobject": {
|
||||
"description": "build gobject module",
|
||||
"dependencies": [
|
||||
"glib"
|
||||
]
|
||||
},
|
||||
"x11": {
|
||||
"description": "build with x11 support"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1046,7 +1046,7 @@
|
|||
},
|
||||
"cairo": {
|
||||
"baseline": "1.16.0",
|
||||
"port-version": 8
|
||||
"port-version": 9
|
||||
},
|
||||
"cairomm": {
|
||||
"baseline": "1.15.3",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "eb09773c303a9608687dca6a0480ff551c0c2bf9",
|
||||
"version-string": "1.16.0",
|
||||
"port-version": 9
|
||||
},
|
||||
{
|
||||
"git-tree": "b3a1d73d5c8c18a8c6512385b59d40719f963c8c",
|
||||
"version-string": "1.16.0",
|
||||
|
|
|
|||
Loading…
Reference in New Issue