aboutsummaryrefslogtreecommitdiff
path: root/ports/io2d
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/io2d
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/io2d')
-rw-r--r--ports/io2d/CONTROL2
-rw-r--r--ports/io2d/find-package.patch47
-rw-r--r--ports/io2d/portfile.cmake35
3 files changed, 62 insertions, 22 deletions
diff --git a/ports/io2d/CONTROL b/ports/io2d/CONTROL
index 331e58551..7e36cb5d9 100644
--- a/ports/io2d/CONTROL
+++ b/ports/io2d/CONTROL
@@ -1,4 +1,4 @@
Source: io2d
-Version: 0.1
+Version: 0.1-1
Description: a lightweight, cross platform drawing library
Build-Depends: cairo, graphicsmagick
diff --git a/ports/io2d/find-package.patch b/ports/io2d/find-package.patch
new file mode 100644
index 000000000..10d83f95b
--- /dev/null
+++ b/ports/io2d/find-package.patch
@@ -0,0 +1,47 @@
+diff --git a/P0267_RefImpl/P0267_RefImpl/cairo/CMakeLists.txt b/P0267_RefImpl/P0267_RefImpl/cairo/CMakeLists.txt
+index 3d4791c..1864b7a 100644
+--- a/P0267_RefImpl/P0267_RefImpl/cairo/CMakeLists.txt
++++ b/P0267_RefImpl/P0267_RefImpl/cairo/CMakeLists.txt
+@@ -23,7 +23,15 @@ target_compile_features(io2d_cairo PUBLIC cxx_std_17)
+
+ target_link_libraries(io2d_cairo PUBLIC io2d_core)
+
+-if(MSVC)
++if(DEFINED VCPKG_TARGET_TRIPLET)
++ find_package(unofficial-cairo CONFIG REQUIRED)
++ set(CAIRO_INCLUDE_DIR)
++ set(CAIRO_LIB_DEBUG "CAIRO_LIB_DEBUG-NOTFOUND")
++ set(CAIRO_LIB_RELEASE unofficial::cairo::cairo)
++ find_package(unofficial-graphicsmagick CONFIG REQUIRED)
++ set(GRAPHICSMAGICK_INCLUDE_DIR)
++ set(GRAPHICSMAGICK_LIB unofficial::graphicsmagick::graphicsmagick)
++elseif(MSVC)
+ find_path(CAIRO_INCLUDE_DIR cairo.h)
+ find_path(GRAPHICSMAGICK_INCLUDE_DIR magick/api.h)
+ find_library(CAIRO_LIB_DEBUG cairod)
+diff --git a/P0267_RefImpl/P0267_RefImpl/cairo/win32/CMakeLists.txt b/P0267_RefImpl/P0267_RefImpl/cairo/win32/CMakeLists.txt
+index abb1501..b7a6e71 100644
+--- a/P0267_RefImpl/P0267_RefImpl/cairo/win32/CMakeLists.txt
++++ b/P0267_RefImpl/P0267_RefImpl/cairo/win32/CMakeLists.txt
+@@ -24,20 +24,7 @@ target_compile_features(io2d_cairo_win32 PUBLIC cxx_std_17)
+ target_link_libraries(io2d_cairo_win32 PUBLIC io2d_cairo)
+
+ if(MSVC)
+- target_compile_definitions(io2d_cairo_win32 PUBLIC -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS)
+-
+- find_library(PIXMAN_LIB pixman-1)
+- find_library(FREETYPE_LIB freetype)
+- find_library(FONTCONFIG_LIB fontconfig)
+- find_library(BZ_LIB bz2)
+- find_library(JPEG_LIB jpeg)
+- find_library(TIFF_LIB tiff)
+- find_library(EXPAT_LIB expat)
+- find_library(LZMA_LIB lzma)
+- find_library(ICONV_LIB libiconv)
+- find_library(CHARSET_LIB libcharset)
+-
+- target_link_libraries(io2d_cairo_win32 PUBLIC ${PIXMAN_LIB} ${FREETYPE_LIB} ${FONTCONFIG_LIB} ${BZ_LIB} ${JPEG_LIB} ${TIFF_LIB} ${EXPAT_LIB} ${LZMA_LIB} ${ICONV_LIB} ${CHARSET_LIB})
++ target_compile_definitions(io2d_cairo_win32 PRIVATE -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS)
+ endif()
+
+ install(
diff --git a/ports/io2d/portfile.cmake b/ports/io2d/portfile.cmake
index 285cab969..c1d536d57 100644
--- a/ports/io2d/portfile.cmake
+++ b/ports/io2d/portfile.cmake
@@ -12,23 +12,25 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
# Retrieve and validate io2d source code, as-needed
if ("${SOURCE_PATH}" STREQUAL "")
+ # TODO: point at cpp-io2d/(whatever), if and as needed
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
-
- # TODO: point at cpp-io2d/(whatever), if and as needed
REPO cpp-io2d/P0267_RefImpl
REF 21ae92c8be6916034e6e18f08aa57899a975dfb0
SHA512 5b674f98ca7705d6901af339a4189d5ce4f2c3118bfb99430734f355159602f177bc8d1b345c3a2f17947a62547553f7b91747a1f16da063707a4da7f990391d
HEAD_REF master
+ PATCHES find-package.patch
)
endif()
# Configure the library, using CMake
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
OPTIONS
-DIO2D_WITHOUT_SAMPLES=1
-DIO2D_WITHOUT_TESTS=1
+ -DCMAKE_INSTALL_INCLUDEDIR:STRING=include
)
# Build + install the library, using CMake
@@ -38,26 +40,17 @@ vcpkg_install_cmake()
# (within <vcpkg-root>/installed/io2d_*/, as installed by vcpkg_install_cmake()):
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
-# Don't have duplicate CMake files
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
-
-# Make sure CMake files are installed to the correct location
-file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/io2d)
-file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/io2d/cmake)
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/io2d)
-# Remove separate io2d directory (dludwig@pobox.com: should this always be true? Whither
-# a single 'io2d.h' file, with sub-headers within a 'io2d' directory, lest we spam someone's
-# 'include' directory?)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/io2d/io2dConfig.cmake ${CURRENT_PACKAGES_DIR}/share/io2d/io2dTargets.cmake)
+file(WRITE ${CURRENT_PACKAGES_DIR}/share/io2d/io2dConfig.cmake "
+include(CMakeFindDependencyMacro)
+find_dependency(unofficial-cairo CONFIG)
+find_dependency(unofficial-graphicsmagick CONFIG)
-# [Re]install io2d headers, using a (currently) flat structure
-file(
- GLOB IO2D_HEADERS
- "${SOURCE_PATH}/P0267_RefImpl/P0267_RefImpl/*.h"
- "${SOURCE_PATH}/P0267_RefImpl/P0267_RefImpl/cairo/*.h"
- "${SOURCE_PATH}/P0267_RefImpl/P0267_RefImpl/cairo/win32/*.h"
-)
-file(INSTALL ${IO2D_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
+include(\${CMAKE_CURRENT_LIST_DIR}/io2dTargets.cmake)
+")
-# Install a copyright file, as suggested by vcpkg itself
file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/io2d RENAME copyright)
+
+vcpkg_test_cmake(PACKAGE_NAME io2d)