aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackBoosY <47264268+JackBoosY@users.noreply.github.com>2019-09-20 06:18:04 +0800
committerPhil Christensen <philc@microsoft.com>2019-09-19 15:18:04 -0700
commit358ec0954d9b71b0def4fd4b4dbafdd0b8478d81 (patch)
tree9690383f66038aa0eceec350b947f2a9811a60e2
parent04b9feb6346c15ddc43c72383a3dfb1b623296ab (diff)
downloadvcpkg-358ec0954d9b71b0def4fd4b4dbafdd0b8478d81.tar.gz
vcpkg-358ec0954d9b71b0def4fd4b4dbafdd0b8478d81.zip
[cairo]Add feature X11. (#8249)
* [cairo]Add feature X11. * [cairo]Add message for feature x11.
-rw-r--r--ports/cairo/CMakeLists.txt8
-rw-r--r--ports/cairo/CONTROL5
-rw-r--r--ports/cairo/portfile.cmake12
3 files changed, 24 insertions, 1 deletions
diff --git a/ports/cairo/CMakeLists.txt b/ports/cairo/CMakeLists.txt
index 750a9850d..eea64b96c 100644
--- a/ports/cairo/CMakeLists.txt
+++ b/ports/cairo/CMakeLists.txt
@@ -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
diff --git a/ports/cairo/CONTROL b/ports/cairo/CONTROL
index d53d5003d..e9d494235 100644
--- a/ports/cairo/CONTROL
+++ b/ports/cairo/CONTROL
@@ -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 \ No newline at end of file
diff --git a/ports/cairo/portfile.cmake b/ports/cairo/portfile.cmake
index ed120f07f..f5b1f35f8 100644
--- a/ports/cairo/portfile.cmake
+++ b/ports/cairo/portfile.cmake
@@ -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()