mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 01:31:48 +08:00
106 lines
3.5 KiB
CMake
106 lines
3.5 KiB
CMake
# Glib uses winapi functions not available in WindowsStore, so glibmm
|
|
# also
|
|
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
|
|
message(FATAL_ERROR "Error: UWP builds are currently not supported.")
|
|
endif()
|
|
|
|
# Glib relies on DllMain, so glibmm also
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
message(STATUS "Warning: Static building not supported. Building dynamic.")
|
|
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
|
endif()
|
|
|
|
include(vcpkg_common_functions)
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glibmm-2.52.1)
|
|
vcpkg_download_distfile(ARCHIVE
|
|
URLS "http://ftp.gnome.org/pub/GNOME/sources/glibmm/2.52/glibmm-2.52.1.tar.xz"
|
|
FILENAME "glibmm-2.52.1.tar.xz"
|
|
SHA512 702158762cb28972b315ab98dc00a62e532bda08b6e76dc2a2556e8cb381c2021290891887a4af2fbff5a62bab4d50581be73037dc8e0dc47d5febd6cbeb7bda
|
|
)
|
|
vcpkg_extract_source_archive(${ARCHIVE})
|
|
|
|
vcpkg_apply_patches(
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix_properties.patch ${CMAKE_CURRENT_LIST_DIR}/fix_charset.patch
|
|
)
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/msvc_recommended_pragmas.h DESTINATION ${SOURCE_PATH}/MSVC_Net2013)
|
|
|
|
set(VS_PLATFORM ${VCPKG_TARGET_ARCHITECTURE})
|
|
if(${VCPKG_TARGET_ARCHITECTURE} STREQUAL x86)
|
|
set(VS_PLATFORM "Win32")
|
|
endif(${VCPKG_TARGET_ARCHITECTURE} STREQUAL x86)
|
|
vcpkg_build_msbuild(
|
|
PROJECT_PATH ${SOURCE_PATH}/MSVC_Net2013/glibmm.sln
|
|
TARGET giomm
|
|
PLATFORM ${VS_PLATFORM}
|
|
# Need this for it to pick up xerces-c port: https://github.com/Microsoft/vcpkg/issues/891
|
|
OPTIONS /p:ForceImportBeforeCppTargets=${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/vcpkg.targets
|
|
)
|
|
|
|
# Handle headers
|
|
file(COPY ${SOURCE_PATH}/MSVC_Net2013/giomm/giommconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include)
|
|
file(COPY ${SOURCE_PATH}/gio/giomm.h DESTINATION ${CURRENT_PACKAGES_DIR}/include)
|
|
file(
|
|
COPY
|
|
${SOURCE_PATH}/gio/giomm
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/include
|
|
FILES_MATCHING PATTERN *.h
|
|
)
|
|
file(COPY ${SOURCE_PATH}/MSVC_Net2013/glibmm/glibmmconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include)
|
|
file(COPY ${SOURCE_PATH}/glib/glibmm.h DESTINATION ${CURRENT_PACKAGES_DIR}/include)
|
|
file(
|
|
COPY
|
|
${SOURCE_PATH}/glib/glibmm
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/include
|
|
FILES_MATCHING PATTERN *.h
|
|
)
|
|
|
|
# Handle libraries
|
|
file(
|
|
COPY
|
|
${SOURCE_PATH}/MSVC_Net2013/Release/${VS_PLATFORM}/bin/giomm.dll
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
|
|
)
|
|
file(
|
|
COPY
|
|
${SOURCE_PATH}/MSVC_Net2013/Release/${VS_PLATFORM}/bin/giomm.lib
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
|
|
)
|
|
file(
|
|
COPY
|
|
${SOURCE_PATH}/MSVC_Net2013/Release/${VS_PLATFORM}/bin/glibmm.dll
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
|
|
)
|
|
file(
|
|
COPY
|
|
${SOURCE_PATH}/MSVC_Net2013/Release/${VS_PLATFORM}/bin/glibmm.lib
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
|
|
)
|
|
file(
|
|
COPY
|
|
${SOURCE_PATH}/MSVC_Net2013/Debug/${VS_PLATFORM}/bin/giomm.dll
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
|
|
)
|
|
file(
|
|
COPY
|
|
${SOURCE_PATH}/MSVC_Net2013/Debug/${VS_PLATFORM}/bin/giomm.lib
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
|
|
)
|
|
file(
|
|
COPY
|
|
${SOURCE_PATH}/MSVC_Net2013/Debug/${VS_PLATFORM}/bin/glibmm.dll
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
|
|
)
|
|
file(
|
|
COPY
|
|
${SOURCE_PATH}/MSVC_Net2013/Debug/${VS_PLATFORM}/bin/glibmm.lib
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
|
|
)
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
# Handle copyright and readme
|
|
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glibmm RENAME copyright)
|
|
file(INSTALL ${SOURCE_PATH}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/glibmm RENAME readme.txt)
|