vcpkg/ports/gtk/portfile.cmake

35 lines
1.4 KiB
CMake
Raw Normal View History

2017-02-19 19:18:08 +08:00
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gtk+-3.22.8)
vcpkg_download_distfile(ARCHIVE
URLS "https://ftp.gnome.org/pub/gnome/sources/gtk+/3.22/gtk+-3.22.8.tar.xz"
FILENAME "gtk+-3.22.8.tar.xz"
SHA512 e8c887d73a29982e8db1be6b101367326b4691905bd28e244f05435f34dfaddb054badb0b0b01a47a4c939c7f87985b7203db5d0cd499a0868c25eba44ed002c)
vcpkg_extract_source_archive(${ARCHIVE})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH})
# generate sources using python script installed with glib
if(NOT EXISTS ${SOURCE_PATH}/gtk/gtkdbusgenerated.h OR NOT EXISTS ${SOURCE_PATH}/gtk/gtkdbusgenerated.c)
vcpkg_find_acquire_program(PYTHON3)
set(GLIB_TOOL_DIR ${CURRENT_INSTALLED_DIR}/tools/glib)
vcpkg_execute_required_process(
COMMAND ${PYTHON3} ${GLIB_TOOL_DIR}/gdbus-codegen --interface-prefix org.Gtk. --c-namespace _Gtk --generate-c-code gtkdbusgenerated ./gtkdbusinterfaces.xml
WORKING_DIRECTORY ${SOURCE_PATH}/gtk
LOGNAME source-gen)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG
-DGTK_SKIP_HEADERS=ON)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/gtk)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/gtk/COPYING ${CURRENT_PACKAGES_DIR}/share/gtk/copyright)