aboutsummaryrefslogtreecommitdiff
path: root/ports/cairo
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-09-11 13:11:51 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2018-09-24 18:08:52 -0700
commitb35f75d646e8e66ac515a0836e9a808bee54c7ba (patch)
treedbee7e5df3473f5aac764dc851318545ce8a82d8 /ports/cairo
parentfd5fe4132c1ea2e5b4277a7ebe2f34f0bfce19fd (diff)
downloadvcpkg-b35f75d646e8e66ac515a0836e9a808bee54c7ba.tar.gz
vcpkg-b35f75d646e8e66ac515a0836e9a808bee54c7ba.zip
[cairo][expat][fontconfig][graphicsmagick][libjpeg-turbo][pixman][tiff] Add unofficial targets and usage information
Diffstat (limited to 'ports/cairo')
-rw-r--r--ports/cairo/CMakeLists.txt79
-rw-r--r--ports/cairo/CONTROL2
-rw-r--r--ports/cairo/portfile.cmake27
3 files changed, 56 insertions, 52 deletions
diff --git a/ports/cairo/CMakeLists.txt b/ports/cairo/CMakeLists.txt
index 5ace57604..137dba7f3 100644
--- a/ports/cairo/CMakeLists.txt
+++ b/ports/cairo/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.11)
project(cairo C)
# Add include directories
@@ -162,14 +162,10 @@ set(CMAKE_DEBUG_POSTFIX "d")
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
-
-# Make the pixman library available
-if(CMAKE_BUILD_TYPE STREQUAL "Debug")
- set(PIXMAN_SUFFIX "d")
-endif()
-find_library(PIXMAN_LIBRARY NAMES pixman-1${PIXMAN_SUFFIX})
-
-find_package(Freetype CONFIG REQUIRED)
+find_package(Freetype REQUIRED)
+find_package(unofficial-glib CONFIG REQUIRED)
+find_package(unofficial-fontconfig CONFIG REQUIRED)
+find_package(unofficial-pixman CONFIG REQUIRED)
# Cairo needs to be told which features of FreeType are availible
add_definitions(
@@ -179,9 +175,6 @@ add_definitions(
-DHAVE_FT_LOAD_SFNT_TABLE=1
-DHAVE_FT_GET_X11_FONT_FORMAT=1)
-# Find FontConfig
-find_library(FONTCONFIG_LIBRARY fontconfig)
-
# additional features for macOS
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_definitions(
@@ -196,20 +189,7 @@ endif()
add_library(cairo ${SOURCES})
-if(MSVC)
- # cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files
- # NOTE: options only available to MSVC, clang in macOS doesn't understand these flags
- target_compile_options(cairo PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4312" PUBLIC "/wd4267"
- PUBLIC "/wd4996" PUBLIC "/wd4311" PUBLIC "/wd4334" PUBLIC "/wd4101")
-endif()
-
-target_link_libraries(cairo gdi32 msimg32 user32 ZLIB::ZLIB PNG::PNG freetype ${PIXMAN_LIBRARY} ${FONTCONFIG_LIBRARY})
-
-install(TARGETS cairo
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION bin
- ARCHIVE DESTINATION lib
-)
+target_link_libraries(cairo PRIVATE gdi32 msimg32 user32 ZLIB::ZLIB PNG::PNG Freetype::Freetype unofficial::pixman::pixman-1 unofficial::fontconfig::fontconfig)
# GObject support module
@@ -225,16 +205,43 @@ if(BUILD_SHARED_LIBS)
PROPERTIES COMPILE_DEFINITIONS "cairo_public=__declspec(dllexport)")
endif()
-# Make GLib's GObject available
-find_path(GLIB_INCLUDE_DIR glib.h)
-find_library(GLIB_LIBRARY NAMES glib-2.0)
-find_library(GOBJECT_LIBRARY NAMES gobject-2.0)
-set(GLIB_LIBRARIES ${GLIB_LIBRARY} ${GOBJECT_LIBRARY})
-
add_library(cairo-gobject ${CAIRO_GOBJECT_SOURCES})
-target_link_libraries(cairo-gobject cairo ${GLIB_LIBRARIES})
-target_include_directories(cairo-gobject PRIVATE ${GLIB_INCLUDE_DIR})
-install(TARGETS cairo-gobject
+target_link_libraries(cairo-gobject PRIVATE cairo unofficial::glib::gobject unofficial::glib::glib)
+
+if(MSVC)
+ # cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files
+ # NOTE: options only available to MSVC, clang in macOS doesn't understand these flags
+ target_compile_options(cairo PRIVATE
+ "/wd4244" "/wd4146" "/wd4312" "/wd4267" "/wd4996" "/wd4311" "/wd4334" "/wd4101"
+ )
+ target_compile_options(cairo-gobject PRIVATE
+ "/wd4244" "/wd4146" "/wd4312" "/wd4267" "/wd4996" "/wd4311" "/wd4334" "/wd4101"
+ )
+endif()
+
+install(TARGETS cairo cairo-gobject
+ EXPORT cairo-targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib)
+ ARCHIVE DESTINATION lib
+)
+
+install(
+ EXPORT cairo-targets
+ NAMESPACE unofficial::cairo::
+ FILE unofficial-cairo-targets.cmake
+ DESTINATION share/unofficial-cairo
+)
+
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unofficial-cairo-config.cmake "
+include(CMakeFindDependencyMacro)
+find_dependency(ZLIB)
+find_dependency(PNG)
+find_dependency(Freetype)
+find_dependency(unofficial-glib CONFIG)
+find_dependency(unofficial-fontconfig CONFIG)
+find_dependency(unofficial-pixman CONFIG)
+
+include(\${CMAKE_CURRENT_LIST_DIR}/unofficial-cairo-targets.cmake)
+")
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unofficial-cairo-config.cmake DESTINATION share/unofficial-cairo)
diff --git a/ports/cairo/CONTROL b/ports/cairo/CONTROL
index eb1964c8a..2f182e84b 100644
--- a/ports/cairo/CONTROL
+++ b/ports/cairo/CONTROL
@@ -1,4 +1,4 @@
Source: cairo
-Version: 1.15.8-2
+Version: 1.15.8-3
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
diff --git a/ports/cairo/portfile.cmake b/ports/cairo/portfile.cmake
index bc74654d0..53d944b54 100644
--- a/ports/cairo/portfile.cmake
+++ b/ports/cairo/portfile.cmake
@@ -1,25 +1,18 @@
-# Common Ambient Variables:
-# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
-# TARGET_TRIPLET is the current triplet (x86-windows, etc)
-# PORT is the current port name (zlib, etc)
-# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
-# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
-#
-
include(vcpkg_common_functions)
set(CAIRO_VERSION 1.15.8)
-set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cairo-${CAIRO_VERSION})
+
vcpkg_download_distfile(ARCHIVE
URLS "http://cairographics.org/snapshots/cairo-${CAIRO_VERSION}.tar.xz"
FILENAME "cairo-${CAIRO_VERSION}.tar.xz"
SHA512 5af1eebf432201dae0efaa5b6766b151d8273ea00dae48e104d56477005b4d423d64b5d11c512736a4cb076632fb2a572ec35becd922825a68d933bb5ff96ca1
)
-vcpkg_extract_source_archive(${ARCHIVE})
-
-vcpkg_apply_patches(
- SOURCE_PATH ${SOURCE_PATH}
- PATCHES "${CMAKE_CURRENT_LIST_DIR}/export-only-in-shared-build.patch"
- "${CMAKE_CURRENT_LIST_DIR}/0001_fix_osx_defined.patch"
+vcpkg_extract_source_archive_ex(
+ OUT_SOURCE_PATH SOURCE_PATH
+ ARCHIVE ${ARCHIVE}
+ REF ${CAIRO_VERSION}
+ PATCHES
+ export-only-in-shared-build.patch
+ 0001_fix_osx_defined.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/src)
@@ -32,6 +25,8 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-cairo TARGET_PATH share/unofficial-cairo)
+
# Copy the appropriate header files.
foreach(FILE
"${SOURCE_PATH}/src/cairo.h"
@@ -64,3 +59,5 @@ file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/cairo
file(RENAME ${CURRENT_PACKAGES_DIR}/share/cairo/COPYING ${CURRENT_PACKAGES_DIR}/share/cairo/copyright)
vcpkg_copy_pdbs()
+
+vcpkg_test_cmake(PACKAGE_NAME unofficial-cairo)