vcpkg/ports/glibmm/portfile.cmake

105 lines
3.3 KiB
CMake
Raw Normal View History

2017-10-22 20:16:33 +08:00
# 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}
2017-10-25 02:57:31 +08:00
PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix_properties.patch ${CMAKE_CURRENT_LIST_DIR}/fix_charset.patch
2017-10-22 20:16:33 +08:00
)
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}
USE_VCPKG_INTEGRATION
2017-10-22 20:16:33 +08:00
)
# 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)