[cairo]Add feature X11. (#8249)

* [cairo]Add feature X11.

* [cairo]Add message for feature x11.
This commit is contained in:
JackBoosY 2019-09-20 06:18:04 +08:00 committed by Phil Christensen
parent 04b9feb634
commit 358ec0954d
3 changed files with 24 additions and 1 deletions

View File

@ -190,6 +190,10 @@ endif()
add_library(cairo ${SOURCES})
if (WITH_X11)
target_compile_definitions(cairo PUBLIC -DCAIRO_HAS_XLIB_SURFACE=1)
endif()
target_link_libraries(cairo PRIVATE ZLIB::ZLIB PNG::PNG Freetype::Freetype unofficial::pixman::pixman-1 unofficial::fontconfig::fontconfig)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
@ -224,6 +228,10 @@ if(MSVC)
)
endif()
if (CAIRO_HAS_XLIB_SURFACE)
file(INSTALL cairo-xlib.h DESTINATION include)
endif()
install(TARGETS cairo cairo-gobject
EXPORT cairo-targets
RUNTIME DESTINATION bin

View File

@ -1,5 +1,8 @@
Source: cairo
Version: 1.16.0-1
Version: 1.16.0-2
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, glib, freetype, fontconfig
Feature: x11
Description: build with x11 support

View File

@ -18,9 +18,21 @@ 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 ("x11" IN_LIST FEATURES)
if (VCPKG_TARGET_IS_WINDOWS)
message(FATAL_ERROR "Feature x11 only support UNIX.")
endif()
message(WARNING "You will need to install Xorg dependencies to use feature x11:\napt install libx11-dev libxft-dev\n")
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
x11 WITH_X11
)
vcpkg_configure_cmake(
PREFER_NINJA
SOURCE_PATH ${SOURCE_PATH}/src
OPTIONS ${FEATURE_OPTIONS}
)
vcpkg_install_cmake()