vcpkg/ports/tgui/portfile.cmake
Kai Pastor df806d3a4b
[sdl2-ttf,tgui,sfml] Update sdl2-ttf to 2.20.0, revise dependencies import and export (#26026)
* [sdl2-ttf] update to 2.20.0

* update version

* add license

* update version

* del unused function

* overwrite version

* Fix sdl2-tff

* Increase version

* version

* Fix config export/import

* version

* Fix sdl2pp

* Fix SDL2_ttf import

* Fix sdl2pp

* Try again

* ...

* shared

* Fix patch

* not win32

* revert

* Fix import name

* Fix tgui

* version

* CR

* version

* CR

* version

* license

* version

* update port version

* version

* Fix patch

* version

* Fix patch

* version

* Update patch

* version

* Fix tgui

* add feature harfbuzz

* version

* Fix feature

* version

* Fix mingw

* Trim patching

* Explicit usage

* [sfml] Fix OpenGL dependency

* [sfml] Transform freetype patch and config fixup

* [sfml] Transform stb patch

* [tgui] Revise port

* [tgui] Extend config patching, merge into dependencies patch

* [tgui] Devendor stb

* [tgui] Revise feature dependencies

* [tgui] Omit pc files (too many inconsistencies)

* [milerius-sfml-imgui] Fixup

* Update versions

Co-authored-by: FrankXie <v-frankxie@microsoft.com>
Co-authored-by: Thomas1664 <46387399+Thomas1664@users.noreply.github.com>
2022-08-04 19:18:37 -07:00

84 lines
3.2 KiB
CMake

if(NOT "sdl2" IN_LIST FEATURES AND NOT "sfml" IN_LIST FEATURES)
message(FATAL_ERROR "At least one of the backend features must be selected: sdl2 sfml")
endif()
if(VCPKG_TARGET_IS_ANDROID)
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
elseif(VCPKG_TARGET_IS_IOS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO texus/TGUI
REF 6515153c2466e6677ba933679b3dca6c283daf87
SHA512 109e64c114336979a4bd0d44765e4bc26cb4ecb6e4db92d7441230d148438b084d01cb56dd292f09a6fd28b0f7420044455ffb519147cc3aea71e322142cd9a0
HEAD_REF 0.9
PATCHES
fix-dependencies.patch
devendor-stb.patch
)
file(REMOVE_RECURSE "${SOURCE_PATH}/src/Backends/SDL/cmake_modules") # Config available
file(REMOVE_RECURSE "${SOURCE_PATH}/include/TGUI/extlibs/stb")
set(TGUI_SHARE_PATH "${CURRENT_PACKAGES_DIR}/share/${PORT}")
set(TGUI_TOOLS_PATH "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" TGUI_USE_STATIC_STD_LIBS)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
sdl2 TGUI_HAS_BACKEND_SDL
sfml TGUI_HAS_BACKEND_SFML
tool TGUI_BUILD_GUI_BUILDER
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
${FEATURE_OPTIONS}
"-DTGUI_MISC_INSTALL_PREFIX=${TGUI_SHARE_PATH}"
"-DCMAKE_INSTALL_DOCDIR=${TGUI_SHARE_PATH}"
-DTGUI_USE_STATIC_STD_LIBS=${TGUI_USE_STATIC_STD_LIBS}
-DTGUI_BACKEND=Custom
-DTGUI_BUILD_DOC=OFF
-DTGUI_BUILD_FRAMEWORK=OFF
-DTGUI_INSTALL_PKGCONFIG_FILES=OFF
OPTIONS_DEBUG
-DTGUI_BUILD_GUI_BUILDER=OFF
MAYBE_UNUSED_VARIABLES
TGUI_BUILD_FRAMEWORK
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/TGUI)
vcpkg_copy_pdbs()
if("tool" IN_LIST FEATURES)
message(STATUS "Check for: ${TGUI_SHARE_PATH}/gui-builder/gui-builder${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
if(EXISTS "${TGUI_SHARE_PATH}/gui-builder/gui-builder${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
file(MAKE_DIRECTORY "${TGUI_TOOLS_PATH}")
file(RENAME
"${TGUI_SHARE_PATH}/gui-builder/gui-builder${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
"${TGUI_TOOLS_PATH}/gui-builder${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
# Need to copy `resources` and `themes` directories
file(COPY "${TGUI_SHARE_PATH}/gui-builder/resources" DESTINATION "${TGUI_TOOLS_PATH}")
file(COPY "${TGUI_SHARE_PATH}/gui-builder/themes" DESTINATION "${TGUI_TOOLS_PATH}")
file(REMOVE_RECURSE "${TGUI_SHARE_PATH}/gui-builder")
vcpkg_copy_tool_dependencies("${TGUI_TOOLS_PATH}")
endif()
endif()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
# Empty folders
"${CURRENT_PACKAGES_DIR}/include/TGUI/extlibs/nanosvg"
"${CURRENT_PACKAGES_DIR}/include/TGUI/extlibs/glad"
)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/license.txt" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright")