2016-11-26 07:48:19 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-09-04 16:04:55 +08:00
|
|
|
set(CAIRO_VERSION 1.15.8)
|
2018-09-12 04:11:51 +08:00
|
|
|
|
2016-11-26 07:48:19 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2017-07-13 23:21:30 +08:00
|
|
|
URLS "http://cairographics.org/snapshots/cairo-${CAIRO_VERSION}.tar.xz"
|
|
|
|
FILENAME "cairo-${CAIRO_VERSION}.tar.xz"
|
2017-09-04 16:04:55 +08:00
|
|
|
SHA512 5af1eebf432201dae0efaa5b6766b151d8273ea00dae48e104d56477005b4d423d64b5d11c512736a4cb076632fb2a572ec35becd922825a68d933bb5ff96ca1
|
2016-11-26 07:48:19 +08:00
|
|
|
)
|
2018-09-12 04:11:51 +08:00
|
|
|
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
|
2017-06-14 14:05:50 +08:00
|
|
|
)
|
|
|
|
|
2017-07-13 23:21:30 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/src)
|
2016-11-26 07:48:19 +08:00
|
|
|
file(COPY ${CURRENT_PORT_DIR}/cairo-features.h DESTINATION ${SOURCE_PATH}/src)
|
|
|
|
|
2017-07-13 23:21:30 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
PREFER_NINJA
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}/src
|
|
|
|
)
|
2016-11-26 07:48:19 +08:00
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2018-09-12 04:11:51 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-cairo TARGET_PATH share/unofficial-cairo)
|
|
|
|
|
2016-11-26 07:48:19 +08:00
|
|
|
# Copy the appropriate header files.
|
2017-06-08 13:35:33 +08:00
|
|
|
foreach(FILE
|
2016-11-26 07:48:19 +08:00
|
|
|
"${SOURCE_PATH}/src/cairo.h"
|
|
|
|
"${SOURCE_PATH}/src/cairo-deprecated.h"
|
|
|
|
"${SOURCE_PATH}/src/cairo-features.h"
|
|
|
|
"${SOURCE_PATH}/src/cairo-pdf.h"
|
|
|
|
"${SOURCE_PATH}/src/cairo-ps.h"
|
|
|
|
"${SOURCE_PATH}/src/cairo-script.h"
|
|
|
|
"${SOURCE_PATH}/src/cairo-svg.h"
|
|
|
|
"${SOURCE_PATH}/cairo-version.h"
|
|
|
|
"${SOURCE_PATH}/src/cairo-win32.h"
|
2017-01-26 18:12:55 +08:00
|
|
|
"${SOURCE_PATH}/util/cairo-gobject/cairo-gobject.h"
|
2017-06-08 13:35:33 +08:00
|
|
|
"${SOURCE_PATH}/src/cairo-ft.h")
|
|
|
|
file(COPY ${FILE} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
|
|
|
|
file(COPY ${FILE} DESTINATION ${CURRENT_PACKAGES_DIR}/include/cairo)
|
|
|
|
endforeach()
|
2017-06-01 14:32:41 +08:00
|
|
|
|
2017-06-08 17:21:21 +08:00
|
|
|
foreach(FILE "${CURRENT_PACKAGES_DIR}/include/cairo.h" "${CURRENT_PACKAGES_DIR}/include/cairo/cairo.h")
|
2017-06-08 15:01:29 +08:00
|
|
|
file(READ ${FILE} CAIRO_H)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
string(REPLACE "defined (CAIRO_WIN32_STATIC_BUILD)" "1" CAIRO_H "${CAIRO_H}")
|
|
|
|
else()
|
|
|
|
string(REPLACE "defined (CAIRO_WIN32_STATIC_BUILD)" "0" CAIRO_H "${CAIRO_H}")
|
|
|
|
endif()
|
|
|
|
file(WRITE ${FILE} "${CAIRO_H}")
|
|
|
|
endforeach()
|
|
|
|
|
2016-11-26 07:48:19 +08:00
|
|
|
# Handle copyright
|
|
|
|
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()
|
2018-09-12 04:11:51 +08:00
|
|
|
|
|
|
|
vcpkg_test_cmake(PACKAGE_NAME unofficial-cairo)
|