Update vcpkg to Qt6 (#4872)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
kornes 2023-10-07 09:09:58 +00:00 committed by GitHub
parent 752825793a
commit ab4a0c054a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 77 additions and 29 deletions

View file

@ -33,6 +33,7 @@
- Dev: Fix qtkeychain include for Qt6 users. (#4863) - Dev: Fix qtkeychain include for Qt6 users. (#4863)
- Dev: Add a compile-time flag `CHATTERINO_UPDATER` which can be turned off to disable update checks. (#4854) - Dev: Add a compile-time flag `CHATTERINO_UPDATER` which can be turned off to disable update checks. (#4854)
- Dev: Add a compile-time flag `USE_SYSTEM_MINIAUDIO` which can be turned on to use the system miniaudio. (#4867) - Dev: Add a compile-time flag `USE_SYSTEM_MINIAUDIO` which can be turned on to use the system miniaudio. (#4867)
- Dev: Update vcpkg to use Qt6. (#4872)
## 2.4.6 ## 2.4.6

View file

@ -8,8 +8,6 @@ list(APPEND CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/cmake/sanitizers-cmake/cmake" "${CMAKE_SOURCE_DIR}/cmake/sanitizers-cmake/cmake"
) )
project(chatterino VERSION 2.4.6)
option(BUILD_APP "Build Chatterino" ON) option(BUILD_APP "Build Chatterino" ON)
option(BUILD_TESTS "Build the tests for Chatterino" OFF) option(BUILD_TESTS "Build the tests for Chatterino" OFF)
option(BUILD_BENCHMARKS "Build the benchmarks for Chatterino" OFF) option(BUILD_BENCHMARKS "Build the benchmarks for Chatterino" OFF)
@ -45,6 +43,15 @@ else()
set(MAJOR_QT_VERSION "5") set(MAJOR_QT_VERSION "5")
endif() endif()
if(BUILD_TESTS)
list(APPEND VCPKG_MANIFEST_FEATURES "tests")
endif()
if(BUILD_BENCHMARKS)
list(APPEND VCPKG_MANIFEST_FEATURES "benchmarks")
endif()
project(chatterino VERSION 2.4.6)
find_program(CCACHE_PROGRAM ccache) find_program(CCACHE_PROGRAM ccache)
find_program(SCCACHE_PROGRAM sccache) find_program(SCCACHE_PROGRAM sccache)
if (SCCACHE_PROGRAM) if (SCCACHE_PROGRAM)

View file

@ -768,35 +768,51 @@ if (BUILD_APP)
set_target_directory_hierarchy(${EXECUTABLE_PROJECT}) set_target_directory_hierarchy(${EXECUTABLE_PROJECT})
if (WIN32) if (WIN32)
if (NOT WINDEPLOYQT_PATH) if (WINDEPLOYQT_PATH)
get_target_property(Qt_Core_Location Qt${MAJOR_QT_VERSION}::Core LOCATION)
get_filename_component(QT_BIN_DIR ${Qt_Core_Location} DIRECTORY)
string(APPEND WINDEPLOYQT_PATH ${QT_BIN_DIR} /windeployqt.exe)
else()
file(TO_CMAKE_PATH "${WINDEPLOYQT_PATH}" WINDEPLOYQT_PATH) file(TO_CMAKE_PATH "${WINDEPLOYQT_PATH}" WINDEPLOYQT_PATH)
else()
if (VCPKG_INSTALLED_DIR AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
find_program(WINDEPLOYQT_PATH NAMES windeployqt.debug.bat)
else()
find_program(WINDEPLOYQT_PATH NAMES windeployqt)
endif()
endif()
if (NOT EXISTS ${WINDEPLOYQT_PATH})
message(FATAL_ERROR "windeployqt.exe not found")
endif() endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug") if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(WINDEPLOYQT_MODE --debug) set(WINDEPLOYQT_MODE --debug)
get_target_property(QT_CORE_LOC Qt${MAJOR_QT_VERSION}::Core LOCATION_DEBUG)
else() else()
set(WINDEPLOYQT_MODE --release) set(WINDEPLOYQT_MODE --release)
get_target_property(QT_CORE_LOC Qt${MAJOR_QT_VERSION}::Core LOCATION)
endif() endif()
get_filename_component(QT_BIN_DIR ${QT_CORE_LOC} DIRECTORY)
set(WINDEPLOYQT_COMMAND_ARGV "${WINDEPLOYQT_PATH}" "$<TARGET_FILE:${EXECUTABLE_PROJECT}>" ${WINDEPLOYQT_MODE} --no-compiler-runtime --no-translations --no-opengl-sw) set(WINDEPLOYQT_COMMAND_ARGV "${WINDEPLOYQT_PATH}" "$<TARGET_FILE:${EXECUTABLE_PROJECT}>" ${WINDEPLOYQT_MODE} --no-compiler-runtime --no-translations --no-opengl-sw)
string(REPLACE ";" " " WINDEPLOYQT_COMMAND "${WINDEPLOYQT_COMMAND_ARGV}") string(REPLACE ";" " " WINDEPLOYQT_COMMAND "${WINDEPLOYQT_COMMAND_ARGV}")
if (X_VCPKG_APPLOCAL_DEPS_INSTALL) install(TARGETS ${EXECUTABLE_PROJECT}
install(TARGETS ${EXECUTABLE_PROJECT} RUNTIME DESTINATION .) RUNTIME_DEPENDENCIES
else() PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-"
install(TARGETS ${EXECUTABLE_PROJECT} POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
RUNTIME_DEPENDENCIES DIRECTORIES ${QT_BIN_DIR}
PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" RUNTIME DESTINATION .)
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
DIRECTORIES ${QT_BIN_DIR} # Hardcoded list of DLLs to install from Qt - these are marked as optional since they only exist for vcpkg
RUNTIME DESTINATION .) install(FILES
install(CODE "message(\"-- Running: ${WINDEPLOYQT_COMMAND} --dir \\\"\${CMAKE_INSTALL_PREFIX}\\\"\")") ${QT_BIN_DIR}/jpeg62.dll
install(CODE "execute_process(COMMAND ${WINDEPLOYQT_COMMAND} --dir \"\${CMAKE_INSTALL_PREFIX}\" COMMAND_ERROR_IS_FATAL ANY)") ${QT_BIN_DIR}/libwebpdemux.dll
endif() ${QT_BIN_DIR}/libwebpmux.dll
${QT_BIN_DIR}/libwebp.dll
${QT_BIN_DIR}/libsharpyuv.dll
DESTINATION .
OPTIONAL)
install(CODE "message(\"-- Running: ${WINDEPLOYQT_COMMAND} --dir \\\"\${CMAKE_INSTALL_PREFIX}\\\"\")")
install(CODE "execute_process(COMMAND ${WINDEPLOYQT_COMMAND} --dir \"\${CMAKE_INSTALL_PREFIX}\" COMMAND_ERROR_IS_FATAL ANY)")
elseif (APPLE) elseif (APPLE)
install(TARGETS ${EXECUTABLE_PROJECT} install(TARGETS ${EXECUTABLE_PROJECT}
RUNTIME DESTINATION bin RUNTIME DESTINATION bin

View file

@ -2,23 +2,47 @@
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "chatterino", "name": "chatterino",
"version": "2.0.0", "version": "2.0.0",
"builtin-baseline": "43f56137beabcd470ac2650cdf3954761f65b70e", "builtin-baseline": "c6d6efed3e9b4242765bfe1b5c5befffd85f7b92",
"dependencies": [ "dependencies": [
"benchmark",
"boost-asio", "boost-asio",
"boost-circular-buffer", "boost-circular-buffer",
"boost-foreach", "boost-foreach",
"boost-interprocess", "boost-interprocess",
"boost-signals2", "boost-signals2",
"boost-variant", "boost-variant",
"gtest",
"openssl",
"qt5-tools"
],
"overrides": [
{ {
"name": "openssl", "name": "qt5compat",
"version-string": "1.1.1n" "default-features": false,
"features": ["textcodec"]
},
{
"name": "qtbase",
"default-features": false,
"features": [
"concurrent",
"gui",
"jpeg",
"network",
"openssl",
"png",
"widgets"
]
},
{
"name": "qtimageformats",
"default-features": false,
"features": ["webp"]
},
"qtsvg"
],
"features": {
"benchmarks": {
"description": "Build benchamarks",
"dependencies": ["benchmark"]
},
"tests": {
"description": "Build tests",
"dependencies": ["gtest"]
} }
] }
} }