mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 00:55:09 -07:00
Some checks are pending
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (actions) (push) Waiting to run
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 26 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Docker / Servatrice (arm) (push) Waiting to run
Build Docker / Servatrice (x86) (push) Waiting to run
Build Docker / Publish multi-platform Servatrice image (push) Blocked by required conditions
* [App] Add onboarding wizard Took 10 minutes Took 3 minutes Took 7 minutes Took 9 minutes Took 2 minutes Took 1 minute Took 7 minutes * Adjust CI Took 14 minutes Took 56 seconds Took 2 seconds Took 3 seconds * Adjust CI again Took 14 minutes Took 2 seconds * Comments and fixes Took 9 seconds Took 1 minute * Rebase. Took 5 minutes Took 50 seconds Took 15 seconds * Comments. Took 7 minutes * CI lol Took 3 minutes * CI again lol Took 4 minutes * Drop some settings, add some new ones. Took 19 minutes * Resize when expanding section Took 4 minutes Took 3 minutes Took 7 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
88 lines
3.1 KiB
CMake
88 lines
3.1 KiB
CMake
# Find a compatible Qt version
|
|
# Inputs: WITH_SERVER, WITH_CLIENT, WITH_ORACLE
|
|
# Optional Input: QT6_DIR -- Hint as to where Qt6 lives on the system
|
|
# Output: COCKATRICE_QT_VERSION_NAME -- Example values: Qt6
|
|
# Output: SERVATRICE_QT_MODULES
|
|
# Output: COCKATRICE_QT_MODULES
|
|
# Output: ORACLE_QT_MODULES
|
|
# Output: TEST_QT_MODULES
|
|
|
|
set(REQUIRED_QT_COMPONENTS Core)
|
|
if(WITH_SERVER)
|
|
set(_SERVATRICE_NEEDED Network Sql WebSockets)
|
|
endif()
|
|
if(WITH_CLIENT)
|
|
set(_COCKATRICE_NEEDED
|
|
Concurrent
|
|
Gui
|
|
Multimedia
|
|
Network
|
|
PrintSupport
|
|
ShaderTools
|
|
Svg
|
|
WebSockets
|
|
Widgets
|
|
Xml
|
|
Quick
|
|
QuickWidgets
|
|
)
|
|
endif()
|
|
if(WITH_ORACLE)
|
|
set(_ORACLE_NEEDED Concurrent Network Svg Widgets)
|
|
endif()
|
|
if(TEST)
|
|
# Union of Qt modules required across all test targets (independent of application targets).
|
|
# When adding a new test that needs additional Qt modules, add them here rather than in the test's CMakeLists.txt.
|
|
set(_TEST_NEEDED Concurrent Network Svg Widgets)
|
|
endif()
|
|
|
|
set(REQUIRED_QT_COMPONENTS ${REQUIRED_QT_COMPONENTS} ${_SERVATRICE_NEEDED} ${_COCKATRICE_NEEDED} ${_ORACLE_NEEDED}
|
|
${_TEST_NEEDED}
|
|
)
|
|
list(REMOVE_DUPLICATES REQUIRED_QT_COMPONENTS)
|
|
|
|
# Linguist is now a component in Qt6 instead of an external package
|
|
find_package(
|
|
Qt6 6.4.2
|
|
COMPONENTS ${REQUIRED_QT_COMPONENTS} Linguist
|
|
QUIET HINTS ${Qt6_DIR}
|
|
)
|
|
if(NOT Qt6_FOUND)
|
|
message(FATAL_ERROR "No suitable version of Qt was found")
|
|
endif()
|
|
set(COCKATRICE_QT_VERSION_NAME Qt6)
|
|
|
|
list(FIND Qt6LinguistTools_TARGETS Qt6::lrelease QT6_LRELEASE_INDEX)
|
|
if(QT6_LRELEASE_INDEX EQUAL -1)
|
|
message(WARNING "Qt6 lrelease not found.")
|
|
endif()
|
|
|
|
list(FIND Qt6LinguistTools_TARGETS Qt6::lupdate QT6_LUPDATE_INDEX)
|
|
if(QT6_LUPDATE_INDEX EQUAL -1)
|
|
message(WARNING "Qt6 lupdate not found.")
|
|
endif()
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
# Establish Qt Plugins directory & Library directories
|
|
get_target_property(QT_LIBRARY_DIR ${COCKATRICE_QT_VERSION_NAME}::Core LOCATION)
|
|
get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} DIRECTORY)
|
|
get_filename_component(QT_PLUGINS_DIR "${Qt6Core_DIR}/../../../${QT6_INSTALL_PLUGINS}" ABSOLUTE)
|
|
get_filename_component(QT_LIBRARY_DIR "${QT_LIBRARY_DIR}/../../.." ABSOLUTE)
|
|
if(UNIX AND APPLE)
|
|
# Mac needs a bit more help finding all necessary components
|
|
list(APPEND QT_LIBRARY_DIR "/usr/local/lib")
|
|
endif()
|
|
message(DEBUG "QT_PLUGINS_DIR = ${QT_PLUGINS_DIR}")
|
|
message(DEBUG "QT_LIBRARY_DIR = ${QT_LIBRARY_DIR}")
|
|
|
|
# Establish exports
|
|
string(REGEX REPLACE "([^;]+)" "${COCKATRICE_QT_VERSION_NAME}::\\1" SERVATRICE_QT_MODULES "${_SERVATRICE_NEEDED}")
|
|
string(REGEX REPLACE "([^;]+)" "${COCKATRICE_QT_VERSION_NAME}::\\1" COCKATRICE_QT_MODULES "${_COCKATRICE_NEEDED}")
|
|
string(REGEX REPLACE "([^;]+)" "${COCKATRICE_QT_VERSION_NAME}::\\1" ORACLE_QT_MODULES "${_ORACLE_NEEDED}")
|
|
string(REGEX REPLACE "([^;]+)" "${COCKATRICE_QT_VERSION_NAME}::\\1" TEST_QT_MODULES "${_TEST_NEEDED}")
|
|
|
|
# Core-only export (useful for headless libs)
|
|
set(QT_CORE_MODULE "${COCKATRICE_QT_VERSION_NAME}::Core")
|
|
|
|
message(STATUS "Found Qt ${${COCKATRICE_QT_VERSION_NAME}_VERSION} at: ${${COCKATRICE_QT_VERSION_NAME}_DIR}")
|