2016-11-26 07:48:19 +08:00
|
|
|
# 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)
|
2017-09-04 16:04:55 +08:00
|
|
|
set(CAIRO_VERSION 1.15.8)
|
2017-07-13 23:21:30 +08:00
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cairo-${CAIRO_VERSION})
|
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
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE})
|
|
|
|
|
2017-06-14 14:05:50 +08:00
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-09-04 16:04:55 +08:00
|
|
|
PATCHES "${CMAKE_CURRENT_LIST_DIR}/export-only-in-shared-build.patch"
|
2018-08-01 08:10:12 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/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()
|
|
|
|
|
|
|
|
# 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()
|