2017-01-12 04:36:21 +08:00
|
|
|
# Glib uses winapi functions not available in WindowsStore
|
|
|
|
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
|
|
|
|
message(FATAL_ERROR "Error: UWP builds are currently not supported.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Glib relies on DllMain
|
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
message(STATUS "Warning: Static building not supported. Building dynamic.")
|
|
|
|
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
|
|
|
endif()
|
2017-01-12 04:20:53 +08:00
|
|
|
|
|
|
|
include(vcpkg_common_functions)
|
2017-03-14 06:29:40 +08:00
|
|
|
set(GLIB_VERSION 2.50.3)
|
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glib-${GLIB_VERSION})
|
2017-01-12 04:20:53 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2017-03-14 06:29:40 +08:00
|
|
|
URLS "https://ftp.gnome.org/pub/gnome/sources/glib/2.50/glib-${GLIB_VERSION}.tar.xz"
|
|
|
|
FILENAME "glib-${GLIB_VERSION}.tar.xz"
|
|
|
|
SHA512 ef35806c15170b6608445f255136c0bebd2d433adf903c2af2865f6a57b4f2fcfc1e4a7cea1a0dac48ff5fe26248fbf7886dba4a8d209506f0a94160df8fb7af)
|
2017-01-12 04:20:53 +08:00
|
|
|
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE})
|
2017-01-14 09:55:41 +08:00
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/use-libiconv-on-windows.patch)
|
2017-01-12 04:20:53 +08:00
|
|
|
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH})
|
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre)
|
2017-01-14 09:55:41 +08:00
|
|
|
file(REMOVE ${SOURCE_PATH}/glib/win_iconv.c)
|
2017-01-12 04:20:53 +08:00
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-03-14 06:29:40 +08:00
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
-DGLIB_VERSION=${GLIB_VERSION}
|
2017-01-12 04:20:53 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DGLIB_SKIP_HEADERS=ON
|
|
|
|
-DGLIB_SKIP_TOOLS=ON)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
vcpkg_copy_pdbs()
|
2017-01-14 09:59:41 +08:00
|
|
|
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/glib)
|
2017-01-12 04:20:53 +08:00
|
|
|
|
|
|
|
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright)
|
|
|
|
|