mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 08:19:01 +08:00
Merge pull request #1455 from codicodi/cairo-1.15.6
[cairo] update to 1.15.6
This commit is contained in:
commit
948e1c2c44
@ -1,3 +1,213 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(cairo VERSION 1.14.6 LANGUAGES C CXX)
|
||||
add_subdirectory(src)
|
||||
project(cairo C)
|
||||
|
||||
# Add include directories
|
||||
include_directories("." "./win32")
|
||||
|
||||
file(GLOB SOURCES
|
||||
"cairo-analysis-surface.c"
|
||||
"cairo-arc.c"
|
||||
"cairo-array.c"
|
||||
"cairo-atomic.c"
|
||||
"cairo-base64-stream.c"
|
||||
"cairo-base85-stream.c"
|
||||
"cairo-bentley-ottmann.c"
|
||||
"cairo-bentley-ottmann-rectangular.c"
|
||||
"cairo-bentley-ottmann-rectilinear.c"
|
||||
"cairo-botor-scan-converter.c"
|
||||
"cairo-boxes.c"
|
||||
"cairo-boxes-intersect.c"
|
||||
"cairo.c"
|
||||
"cairo-cache.c"
|
||||
"cairo-clip.c"
|
||||
"cairo-clip-boxes.c"
|
||||
"cairo-clip-polygon.c"
|
||||
"cairo-clip-region.c"
|
||||
"cairo-clip-surface.c"
|
||||
"cairo-color.c"
|
||||
"cairo-composite-rectangles.c"
|
||||
"cairo-compositor.c"
|
||||
"cairo-contour.c"
|
||||
"cairo-damage.c"
|
||||
"cairo-debug.c"
|
||||
"cairo-default-context.c"
|
||||
"cairo-device.c"
|
||||
"cairo-error.c"
|
||||
"cairo-fallback-compositor.c"
|
||||
"cairo-fixed.c"
|
||||
"cairo-font-face.c"
|
||||
"cairo-font-face-twin.c"
|
||||
"cairo-font-face-twin-data.c"
|
||||
"cairo-font-options.c"
|
||||
"cairo-freelist.c"
|
||||
"cairo-freed-pool.c"
|
||||
"cairo-gstate.c"
|
||||
"cairo-hash.c"
|
||||
"cairo-hull.c"
|
||||
"cairo-image-compositor.c"
|
||||
"cairo-image-info.c"
|
||||
"cairo-image-source.c"
|
||||
"cairo-image-surface.c"
|
||||
"cairo-line.c"
|
||||
"cairo-lzw.c"
|
||||
"cairo-matrix.c"
|
||||
"cairo-mask-compositor.c"
|
||||
"cairo-mesh-pattern-rasterizer.c"
|
||||
"cairo-mempool.c"
|
||||
"cairo-misc.c"
|
||||
"cairo-mono-scan-converter.c"
|
||||
"cairo-mutex.c"
|
||||
"cairo-no-compositor.c"
|
||||
"cairo-observer.c"
|
||||
"cairo-output-stream.c"
|
||||
"cairo-paginated-surface.c"
|
||||
"cairo-path-bounds.c"
|
||||
"cairo-path.c"
|
||||
"cairo-path-fill.c"
|
||||
"cairo-path-fixed.c"
|
||||
"cairo-path-in-fill.c"
|
||||
"cairo-path-stroke.c"
|
||||
"cairo-path-stroke-boxes.c"
|
||||
"cairo-path-stroke-polygon.c"
|
||||
"cairo-path-stroke-traps.c"
|
||||
"cairo-path-stroke-tristrip.c"
|
||||
"cairo-pattern.c"
|
||||
"cairo-pen.c"
|
||||
"cairo-polygon.c"
|
||||
"cairo-polygon-intersect.c"
|
||||
"cairo-polygon-reduce.c"
|
||||
"cairo-raster-source-pattern.c"
|
||||
"cairo-recording-surface.c"
|
||||
"cairo-rectangle.c"
|
||||
"cairo-rectangular-scan-converter.c"
|
||||
"cairo-region.c"
|
||||
"cairo-rtree.c"
|
||||
"cairo-scaled-font.c"
|
||||
"cairo-shape-mask-compositor.c"
|
||||
"cairo-slope.c"
|
||||
"cairo-spans.c"
|
||||
"cairo-spans-compositor.c"
|
||||
"cairo-spline.c"
|
||||
"cairo-stroke-dash.c"
|
||||
"cairo-stroke-style.c"
|
||||
"cairo-surface.c"
|
||||
"cairo-surface-clipper.c"
|
||||
"cairo-surface-fallback.c"
|
||||
"cairo-surface-observer.c"
|
||||
"cairo-surface-offset.c"
|
||||
"cairo-surface-snapshot.c"
|
||||
"cairo-surface-subsurface.c"
|
||||
"cairo-surface-wrapper.c"
|
||||
"cairo-time.c"
|
||||
"cairo-tor-scan-converter.c"
|
||||
"cairo-tor22-scan-converter.c"
|
||||
"cairo-clip-tor-scan-converter.c"
|
||||
"cairo-tag-attributes.c"
|
||||
"cairo-tag-stack.c"
|
||||
"cairo-toy-font-face.c"
|
||||
"cairo-traps.c"
|
||||
"cairo-tristrip.c"
|
||||
"cairo-traps-compositor.c"
|
||||
"cairo-unicode.c"
|
||||
"cairo-user-font.c"
|
||||
"cairo-version.c"
|
||||
"cairo-wideint.c"
|
||||
# win32
|
||||
"win32/cairo-win32-debug.c"
|
||||
"win32/cairo-win32-device.c"
|
||||
"win32/cairo-win32-gdi-compositor.c"
|
||||
"win32/cairo-win32-system.c"
|
||||
"win32/cairo-win32-surface.c"
|
||||
"win32/cairo-win32-display-surface.c"
|
||||
"win32/cairo-win32-printing-surface.c"
|
||||
"win32/cairo-win32-font.c"
|
||||
# generic font support
|
||||
"cairo-cff-subset.c"
|
||||
"cairo-scaled-font-subsets.c"
|
||||
"cairo-truetype-subset.c"
|
||||
"cairo-type1-fallback.c"
|
||||
"cairo-type1-glyph-names.c"
|
||||
"cairo-type1-subset.c"
|
||||
"cairo-type3-glyph-surface.c"
|
||||
# pdf
|
||||
"cairo-pdf-interchange.c"
|
||||
"cairo-pdf-operators.c"
|
||||
"cairo-pdf-shading.c"
|
||||
"cairo-pdf-surface.c"
|
||||
# png
|
||||
"cairo-png.c"
|
||||
# ps surface
|
||||
"cairo-ps-surface.c"
|
||||
# deflate source
|
||||
"cairo-deflate-stream.c"
|
||||
# svg surface
|
||||
"cairo-svg-surface.c"
|
||||
# script surface
|
||||
"cairo-script-surface.c"
|
||||
# fontconfig + freetype
|
||||
"cairo-ft-font.c"
|
||||
)
|
||||
|
||||
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)
|
||||
|
||||
# Cairo needs to be told which features of FreeType are availible
|
||||
add_definitions(
|
||||
-DHAVE_FT_GLYPHSLOT_EMBOLDEN=1
|
||||
-DHAVE_FT_LIBRARY_SETLCDFILTER=1
|
||||
-DHAVE_FT_GLYPHSLOT_OBLIQUE=1
|
||||
-DHAVE_FT_LOAD_SFNT_TABLE=1
|
||||
-DHAVE_FT_GET_X11_FONT_FORMAT=1)
|
||||
|
||||
# Find FontConfig
|
||||
find_library(FONTCONFIG_LIBRARY fontconfig)
|
||||
|
||||
add_library(cairo ${SOURCES})
|
||||
# cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files
|
||||
target_compile_options(cairo PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4312" PUBLIC "/wd4267"
|
||||
PUBLIC "/wd4996" PUBLIC "/wd4311" PUBLIC "/wd4334" PUBLIC "/wd4101")
|
||||
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
|
||||
)
|
||||
|
||||
# GObject support module
|
||||
|
||||
set(CAIRO_GOBJECT_SOURCES
|
||||
"../util/cairo-gobject/cairo-gobject-enums.c"
|
||||
"../util/cairo-gobject/cairo-gobject-structs.c")
|
||||
|
||||
# GObject support sources do not include header with export macro
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set_source_files_properties(
|
||||
"../util/cairo-gobject/cairo-gobject-enums.c"
|
||||
"../util/cairo-gobject/cairo-gobject-structs.c"
|
||||
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
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
|
@ -1,311 +0,0 @@
|
||||
set(CURRENT_INSTALLED_DIR ${CMAKE_PREFIX_PATH})
|
||||
|
||||
# Add include directories
|
||||
include_directories("." "./win32" "${CURRENT_INSTALLED_DIR}/include")
|
||||
|
||||
file(GLOB SOURCES
|
||||
"cairo-analysis-surface.c"
|
||||
"cairo-arc.c"
|
||||
"cairo-array.c"
|
||||
"cairo-atomic.c"
|
||||
"cairo-base64-stream.c"
|
||||
"cairo-base85-stream.c"
|
||||
"cairo-bentley-ottmann.c"
|
||||
"cairo-bentley-ottmann-rectangular.c"
|
||||
"cairo-bentley-ottmann-rectilinear.c"
|
||||
"cairo-botor-scan-converter.c"
|
||||
"cairo-boxes.c"
|
||||
"cairo-boxes-intersect.c"
|
||||
"cairo.c"
|
||||
"cairo-cache.c"
|
||||
"cairo-clip.c"
|
||||
"cairo-clip-boxes.c"
|
||||
"cairo-clip-polygon.c"
|
||||
"cairo-clip-region.c"
|
||||
"cairo-clip-surface.c"
|
||||
"cairo-color.c"
|
||||
"cairo-composite-rectangles.c"
|
||||
"cairo-compositor.c"
|
||||
"cairo-contour.c"
|
||||
"cairo-damage.c"
|
||||
"cairo-debug.c"
|
||||
"cairo-default-context.c"
|
||||
"cairo-device.c"
|
||||
"cairo-error.c"
|
||||
"cairo-fallback-compositor.c"
|
||||
"cairo-fixed.c"
|
||||
"cairo-font-face.c"
|
||||
"cairo-font-face-twin.c"
|
||||
"cairo-font-face-twin-data.c"
|
||||
"cairo-font-options.c"
|
||||
"cairo-freelist.c"
|
||||
"cairo-freed-pool.c"
|
||||
"cairo-gstate.c"
|
||||
"cairo-hash.c"
|
||||
"cairo-hull.c"
|
||||
"cairo-image-compositor.c"
|
||||
"cairo-image-info.c"
|
||||
"cairo-image-source.c"
|
||||
"cairo-image-surface.c"
|
||||
"cairo-line.c"
|
||||
"cairo-lzw.c"
|
||||
"cairo-matrix.c"
|
||||
"cairo-mask-compositor.c"
|
||||
"cairo-mesh-pattern-rasterizer.c"
|
||||
"cairo-mempool.c"
|
||||
"cairo-misc.c"
|
||||
"cairo-mono-scan-converter.c"
|
||||
"cairo-mutex.c"
|
||||
"cairo-no-compositor.c"
|
||||
"cairo-observer.c"
|
||||
"cairo-output-stream.c"
|
||||
"cairo-paginated-surface.c"
|
||||
"cairo-path-bounds.c"
|
||||
"cairo-path.c"
|
||||
"cairo-path-fill.c"
|
||||
"cairo-path-fixed.c"
|
||||
"cairo-path-in-fill.c"
|
||||
"cairo-path-stroke.c"
|
||||
"cairo-path-stroke-boxes.c"
|
||||
"cairo-path-stroke-polygon.c"
|
||||
"cairo-path-stroke-traps.c"
|
||||
"cairo-path-stroke-tristrip.c"
|
||||
"cairo-pattern.c"
|
||||
"cairo-pen.c"
|
||||
"cairo-polygon.c"
|
||||
"cairo-polygon-intersect.c"
|
||||
"cairo-polygon-reduce.c"
|
||||
"cairo-raster-source-pattern.c"
|
||||
"cairo-recording-surface.c"
|
||||
"cairo-rectangle.c"
|
||||
"cairo-rectangular-scan-converter.c"
|
||||
"cairo-region.c"
|
||||
"cairo-rtree.c"
|
||||
"cairo-scaled-font.c"
|
||||
"cairo-shape-mask-compositor.c"
|
||||
"cairo-slope.c"
|
||||
"cairo-spans.c"
|
||||
"cairo-spans-compositor.c"
|
||||
"cairo-spline.c"
|
||||
"cairo-stroke-dash.c"
|
||||
"cairo-stroke-style.c"
|
||||
"cairo-surface.c"
|
||||
"cairo-surface-clipper.c"
|
||||
"cairo-surface-fallback.c"
|
||||
"cairo-surface-observer.c"
|
||||
"cairo-surface-offset.c"
|
||||
"cairo-surface-snapshot.c"
|
||||
"cairo-surface-subsurface.c"
|
||||
"cairo-surface-wrapper.c"
|
||||
"cairo-time.c"
|
||||
"cairo-tor-scan-converter.c"
|
||||
"cairo-tor22-scan-converter.c"
|
||||
"cairo-clip-tor-scan-converter.c"
|
||||
"cairo-tag-attributes.c"
|
||||
"cairo-tag-stack.c"
|
||||
"cairo-toy-font-face.c"
|
||||
"cairo-traps.c"
|
||||
"cairo-tristrip.c"
|
||||
"cairo-traps-compositor.c"
|
||||
"cairo-unicode.c"
|
||||
"cairo-user-font.c"
|
||||
"cairo-version.c"
|
||||
"cairo-wideint.c"
|
||||
# win32
|
||||
"win32/cairo-win32-debug.c"
|
||||
"win32/cairo-win32-device.c"
|
||||
"win32/cairo-win32-gdi-compositor.c"
|
||||
"win32/cairo-win32-system.c"
|
||||
"win32/cairo-win32-surface.c"
|
||||
"win32/cairo-win32-display-surface.c"
|
||||
"win32/cairo-win32-printing-surface.c"
|
||||
"win32/cairo-win32-font.c"
|
||||
# generic font support
|
||||
"cairo-cff-subset.c"
|
||||
"cairo-scaled-font-subsets.c"
|
||||
"cairo-truetype-subset.c"
|
||||
"cairo-type1-fallback.c"
|
||||
"cairo-type1-glyph-names.c"
|
||||
"cairo-type1-subset.c"
|
||||
"cairo-type3-glyph-surface.c"
|
||||
# pdf
|
||||
"cairo-pdf-interchange.c"
|
||||
"cairo-pdf-operators.c"
|
||||
"cairo-pdf-shading.c"
|
||||
"cairo-pdf-surface.c"
|
||||
# png
|
||||
"cairo-png.c"
|
||||
# ps surface
|
||||
"cairo-ps-surface.c"
|
||||
# deflate source
|
||||
"cairo-deflate-stream.c"
|
||||
# svg surface
|
||||
"cairo-svg-surface.c"
|
||||
# script surface
|
||||
"cairo-script-surface.c"
|
||||
# fontconfig + freetype
|
||||
"cairo-ft-font.c"
|
||||
)
|
||||
|
||||
set(CMAKE_DEBUG_POSTFIX "d")
|
||||
|
||||
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
||||
# Make the zlib library available
|
||||
find_library(ZLIB_DEBUG_IMPLIB NAMES zlibd)
|
||||
if (ZLIB_DEBUG_IMPLIB STREQUAL ZLIB_DEBUG_IMPLIB-NOTFOUND)
|
||||
message(FATAL_ERROR "The zlibd.lib import library could not be found. Check to ensure that zlib is properly installed.")
|
||||
endif()
|
||||
add_library(zlib UNKNOWN IMPORTED)
|
||||
set_property(TARGET zlib PROPERTY IMPORTED_LOCATION "${ZLIB_DEBUG_IMPLIB}")
|
||||
|
||||
# Make the libpng library available
|
||||
find_library(LIBPNG_DEBUG_IMPLIB NAMES libpng16d)
|
||||
if (LIBPNG_DEBUG_IMPLIB STREQUAL LIBPNG_DEBUG_IMPLIB-NOTFOUND)
|
||||
message(FATAL_ERROR "The libpng16d.lib import library could not be found. Check to ensure that libpng is properly installed.")
|
||||
endif()
|
||||
add_library(libpng UNKNOWN IMPORTED)
|
||||
set_property(TARGET libpng PROPERTY IMPORTED_LOCATION "${LIBPNG_DEBUG_IMPLIB}")
|
||||
|
||||
# Make the pixman library available
|
||||
find_library(PIXMAN_DEBUG_IMPLIB NAMES pixman-1d)
|
||||
if (PIXMAN_DEBUG_IMPLIB STREQUAL PIXMAN_DEBUG_IMPLIB-NOTFOUND)
|
||||
message(FATAL_ERROR "The pixman-1d.lib import library could not be found. Check to ensure that pixman is properly installed.")
|
||||
endif()
|
||||
add_library(pixman UNKNOWN IMPORTED)
|
||||
set_property(TARGET pixman PROPERTY IMPORTED_LOCATION "${PIXMAN_DEBUG_IMPLIB}")
|
||||
|
||||
elseif (${CMAKE_BUILD_TYPE} STREQUAL "Release")
|
||||
# Make the zlib library available
|
||||
find_library(ZLIB_RELEASE_IMPLIB NAMES zlib)
|
||||
if (ZLIB_RELEASE_IMPLIB STREQUAL ZLIB_RELEASE_IMPLIB-NOTFOUND)
|
||||
message(FATAL_ERROR "The zlib.lib import library could not be found. Check to ensure that zlib is properly installed.")
|
||||
endif()
|
||||
add_library(zlib UNKNOWN IMPORTED)
|
||||
set_property(TARGET zlib PROPERTY IMPORTED_LOCATION "${ZLIB_RELEASE_IMPLIB}")
|
||||
|
||||
# Make the libpng library available
|
||||
find_library(LIBPNG_RELEASE_IMPLIB NAMES libpng16)
|
||||
if (LIBPNG_RELEASE_IMPLIB STREQUAL LIBPNG_RELEASE_IMPLIB-NOTFOUND)
|
||||
message(FATAL_ERROR "The libpng16.lib import library could not be found. Check to ensure that libpng is properly installed.")
|
||||
endif()
|
||||
add_library(libpng UNKNOWN IMPORTED)
|
||||
set_property(TARGET libpng PROPERTY IMPORTED_LOCATION "${LIBPNG_RELEASE_IMPLIB}")
|
||||
|
||||
# Make the pixman library available
|
||||
find_library(PIXMAN_RELEASE_IMPLIB NAMES pixman-1)
|
||||
if (PIXMAN_RELEASE_IMPLIB STREQUAL PIXMAN_RELEASE_IMPLIB-NOTFOUND)
|
||||
message(FATAL_ERROR "The pixman-1.lib import library could not be found. Check to ensure that pixman is properly installed.")
|
||||
endif()
|
||||
add_library(pixman UNKNOWN IMPORTED)
|
||||
set_property(TARGET pixman PROPERTY IMPORTED_LOCATION "${PIXMAN_RELEASE_IMPLIB}")
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Unexpected value '${CMAKE_BUILD_TYPE}' for CMAKE_BUILD_TYPE.")
|
||||
endif()
|
||||
|
||||
# Make the gdi32 library available
|
||||
find_library(GDI32_LIBRARY NAMES gdi32)
|
||||
if (GDI32_LIBRARY STREQUAL GDI32_LIBRARY-NOTFOUND)
|
||||
message(FATAL_ERROR "The gdi32.lib import library could not be found. Check to ensure that the Windows SDK is installed.")
|
||||
endif()
|
||||
add_library(gdi32 UNKNOWN IMPORTED)
|
||||
set_property(TARGET gdi32 PROPERTY IMPORTED_LOCATION "${GDI32_LIBRARY}")
|
||||
|
||||
# Make the msimg32 library available
|
||||
find_library(MSIMG32_LIBRARY NAMES msimg32)
|
||||
if (MSIMG32_LIBRARY STREQUAL MSIMG32_LIBRARY-NOTFOUND)
|
||||
message(FATAL_ERROR "The msimg32.lib import library could not be found. Check to ensure that the Windows SDK is installed.")
|
||||
endif()
|
||||
add_library(msimg32 UNKNOWN IMPORTED)
|
||||
set_property(TARGET msimg32 PROPERTY IMPORTED_LOCATION "${MSIMG32_LIBRARY}")
|
||||
|
||||
# Make the user32 library available
|
||||
find_library(USER32_LIBRARY NAMES user32)
|
||||
if (USER32_LIBRARY STREQUAL USER32_LIBRARY-NOTFOUND)
|
||||
message(FATAL_ERROR "The user32.lib import library could not be found. Check to ensure that the Windows SDK is installed.")
|
||||
endif()
|
||||
add_library(user32 UNKNOWN IMPORTED)
|
||||
set_property(TARGET user32 PROPERTY IMPORTED_LOCATION "${USER32_LIBRARY}")
|
||||
|
||||
# Find dependencies of optional modules
|
||||
|
||||
# Find FreeType
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
set(FREETYPE_SUFFIX d)
|
||||
endif()
|
||||
find_library(FREETYPE_LIBRARY freetype${FREETYPE_SUFFIX})
|
||||
if (FREETYPE_LIBRARY MATCHES NOTFOUND)
|
||||
message(FATAL_ERROR "The freetype library could not be found. Check to ensure that it is properly installed.")
|
||||
endif()
|
||||
|
||||
# Cairo needs to be told which features of FreeType are availible
|
||||
add_definitions(
|
||||
-DHAVE_FT_GLYPHSLOT_EMBOLDEN=1
|
||||
-DHAVE_FT_LIBRARY_SETLCDFILTER=1
|
||||
-DHAVE_FT_GLYPHSLOT_OBLIQUE=1
|
||||
-DHAVE_FT_LOAD_SFNT_TABLE=1
|
||||
-DHAVE_FT_GET_X11_FONT_FORMAT=1)
|
||||
|
||||
# Find FontConfig
|
||||
find_library(FONTCONFIG_LIBRARY fontconfig)
|
||||
if (FONTCONFIG_LIBRARY MATCHES NOTFOUND)
|
||||
message(FATAL_ERROR "The fontconfig library could not be found. Check to ensure that it is properly installed.")
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_library(cairo ${SOURCES})
|
||||
# cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files
|
||||
target_compile_options(cairo PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4312" PUBLIC "/wd4267" PUBLIC "/wd4996" PUBLIC "/wd4311" PUBLIC "/wd4334" PUBLIC "/wd4101")
|
||||
target_link_libraries(cairo gdi32 msimg32 user32 zlib libpng pixman ${FREETYPE_LIBRARY} ${FONTCONFIG_LIBRARY})
|
||||
|
||||
install(TARGETS cairo
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
else()
|
||||
add_library(cairo-static ${SOURCES})
|
||||
target_compile_options(cairo-static PUBLIC "/DCAIRO_WIN32_STATIC_BUILD=1")
|
||||
# cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files
|
||||
target_compile_options(cairo-static PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4312" PUBLIC "/wd4267" PUBLIC "/wd4996" PUBLIC "/wd4311" PUBLIC "/wd4334" PUBLIC "/wd4101")
|
||||
target_link_libraries(cairo-static gdi32 msimg32 user32 zlib libpng pixman ${FREETYPE_LIBRARY} ${FONTCONFIG_LIBRARY})
|
||||
|
||||
install(TARGETS cairo-static
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
endif()
|
||||
|
||||
# GObject support module
|
||||
|
||||
set(CAIRO_GOBJECT_SOURCES
|
||||
"../util/cairo-gobject/cairo-gobject-enums.c"
|
||||
"../util/cairo-gobject/cairo-gobject-structs.c")
|
||||
|
||||
# GObject support sources do not include header with export macro
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set_source_files_properties(
|
||||
"../util/cairo-gobject/cairo-gobject-enums.c"
|
||||
"../util/cairo-gobject/cairo-gobject-structs.c"
|
||||
PROPERTIES COMPILE_DEFINITIONS cairo_public=__declspec\(dllexport\))
|
||||
endif()
|
||||
|
||||
# Make GLib's GObject available
|
||||
find_library(GLIB_LIBRARY NAMES glib-2.0)
|
||||
find_library(GOBJECT_LIBRARY NAMES gobject-2.0)
|
||||
set(GLIB_LIBRARIES ${GLIB_LIBRARY} ${GOBJECT_LIBRARY})
|
||||
if (GLIB_LIBRARIES MATCHES NOTFOUND)
|
||||
message(FATAL_ERROR "The glib library could not be found. Check to ensure that it is properly installed.")
|
||||
endif()
|
||||
|
||||
add_library(cairo-gobject ${CAIRO_GOBJECT_SOURCES})
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_link_libraries(cairo-gobject cairo ${GLIB_LIBRARIES})
|
||||
else()
|
||||
target_link_libraries(cairo-gobject cairo-static ${GLIB_LIBRARIES})
|
||||
endif()
|
||||
install(TARGETS cairo-gobject
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
@ -1,4 +1,4 @@
|
||||
Source: cairo
|
||||
Version: 1.15.4-3
|
||||
Version: 1.15.6
|
||||
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
|
||||
|
15
ports/cairo/export-only-in-shared-build.patch
Normal file
15
ports/cairo/export-only-in-shared-build.patch
Normal file
@ -0,0 +1,15 @@
|
||||
diff --git a/src/cairoint.h b/src/cairoint.h
|
||||
index 4fedf86..dfa149e 100644
|
||||
--- a/src/cairoint.h
|
||||
+++ b/src/cairoint.h
|
||||
@@ -50,7 +50,9 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
-#ifdef _MSC_VER
|
||||
+#if defined _MSC_VER && defined cairo_EXPORTS
|
||||
#define cairo_public __declspec(dllexport)
|
||||
+#else
|
||||
+#define cairo_public
|
||||
#endif
|
||||
|
@ -7,33 +7,28 @@
|
||||
#
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cairo-1.15.4)
|
||||
set(CAIRO_VERSION 1.15.6)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cairo-${CAIRO_VERSION})
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "http://cairographics.org/snapshots/cairo-1.15.4.tar.xz"
|
||||
FILENAME "cairo-1.15.4.tar.xz"
|
||||
SHA512 ac3e6879fcf0876bca9f801cdf9e970ef1822644228cdd21962d0bf5db5fc074973f4ae651eb9c76b44fffd405cf0a0c7cbb228dba96b835ea137a2740277ee9
|
||||
URLS "http://cairographics.org/snapshots/cairo-${CAIRO_VERSION}.tar.xz"
|
||||
FILENAME "cairo-${CAIRO_VERSION}.tar.xz"
|
||||
SHA512 e4eccba745a03545001ebd6f1a7b87bee4b932f80a2d877a764500ad5c18011a5bac585f31eec6d0b65ccaa818de0df2b3b99f0792111363bd3554cfa7f688b6
|
||||
)
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/Initialize-mutexes-for-static-builds-for-win32.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/export-only-in-shared-build.patch"
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_cairo.txt DESTINATION ${SOURCE_PATH}/src)
|
||||
file(RENAME ${SOURCE_PATH}/src/CMakeLists_cairo.txt ${SOURCE_PATH}/src/CMakeLists.txt)
|
||||
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 (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
)
|
||||
elseif (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
)
|
||||
endif()
|
||||
vcpkg_configure_cmake(
|
||||
PREFER_NINJA
|
||||
SOURCE_PATH ${SOURCE_PATH}/src
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user