This commit is contained in:
tooomm 2026-09-20 18:53:01 +02:00 committed by GitHub
commit 82f4250956
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
44 changed files with 273 additions and 279 deletions

View file

@ -136,7 +136,7 @@ cd "$BUILD_DIR"
# Set minimum CMake Version
export CMAKE_POLICY_VERSION_MINIMUM=3.10
# Add cmake flags
# Add CMake flags
flags=("-DCMAKE_BUILD_TYPE=$BUILDTYPE")
if [[ $MAKE_SERVER ]]; then
flags+=("-DWITH_SERVER=1")
@ -153,7 +153,7 @@ if [[ $USE_CCACHE ]]; then
# consumes a precompiled header, silently recompiling everything on every run.
ccache --set-config sloppiness=pch_defines,time_macros
if [[ $CCACHE_SIZE ]]; then
# note, this setting persists after running the script
# This setting persists after running the script
ccache --max-size "$CCACHE_SIZE"
fi
fi
@ -165,17 +165,11 @@ if [[ $USE_VCPKG ]]; then
flags+=("-DVCPKG_INSTALL_OPTIONS=--x-abi-tools-use-exact-versions")
fi
# Add cmake --build flags
# Add CMake --build flags
buildflags=(--config "$BUILDTYPE")
function ccachestatsverbose() {
# note, verbose only works on newer ccache, discard the error
local got
if got="$(ccache --show-stats --verbose 2>/dev/null)"; then
echo "$got"
else
ccache --show-stats
fi
ccache --show-stats --verbose
}
# Compile
@ -188,10 +182,12 @@ if [[ $RUNNER_OS == macOS ]]; then
echo "could not find QTDIR!"
exit 2
fi
# the qtdir is located at Qt/[qtversion]/macos
# we use find to get the first subfolder with the name "macos"
# this works independent of the qt version as there should be only one version installed on the runner at a time
# QTDIR is located at Qt/<QtVersion>/macos
# We use find to get the first subfolder with the name "macos"
# This works independent of the Qt version as there should be only one version installed on the runner at a time
export QTDIR
# Add QTDIR to CMAKE_PREFIX_PATH so CMake can find Qt6
export CMAKE_PREFIX_PATH="$QTDIR:$CMAKE_PREFIX_PATH"
if [[ $TARGET_MACOS_VERSION ]]; then
# CMAKE_OSX_DEPLOYMENT_TARGET is a vanilla cmake flag needed to compile to target macOS version
@ -239,7 +235,7 @@ if [[ $RUNNER_OS == macOS ]]; then
if [[ $MAKE_PACKAGE ]]; then
# Workaround https://github.com/actions/runner-images/issues/7522
# have hdiutil repeat the command 10 times in hope of success
# Have hdiutil repeat the command 10 times in hope of success
hdiutil_script="/tmp/hdiutil.sh"
# shellcheck disable=SC2016
echo '#!/bin/bash

View file

@ -31,7 +31,7 @@ if [[ ! -e $FILE ]]; then
fi
# print version
if ! lupdate -version; then
if ! /usr/lib/qt6/bin/lupdate -version; then
echo "failed to run lupdate" >&2
exit 4;
fi
@ -39,7 +39,7 @@ fi
# run lupdate, duplicating the output in stderr and saving it
# for convenience we ignore that $DIRS will be split on spaces
# shellcheck disable=SC2086
if ! got="$(lupdate $DIRS -ts "$FILE" | tee /dev/stderr)"; then
if ! got="$(/usr/lib/qt6/bin/lupdate $DIRS -ts "$FILE" | tee /dev/stderr)"; then
echo "failed to update $FILE with $DIRS" >&2
exit 4;
fi

View file

@ -30,13 +30,13 @@ jobs:
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends qttools5-dev-tools
sudo apt-get install -y --no-install-recommends qt6-l10n-tools
- name: "Update Cockatrice translation source"
env:
FILE: cockatrice/cockatrice_en@source.ts
id: cockatrice
shell: bash
env:
FILE: cockatrice/cockatrice_en@source.ts
run: >
DIRS="cockatrice/src $(find . -maxdepth 1 -type d -name 'libcockatrice_*')"
.ci/update_translation_source_strings.sh

View file

@ -5,8 +5,7 @@
# This file sets all the variables shared between the projects
# like the installation path, compilation flags etc..
# 3.16 required for Qt6 and target_precompile_headers()
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.25)
# Use compiler cache (ccache)
option(USE_CCACHE "Cache the build results with ccache" ON)
@ -59,29 +58,12 @@ elseif(USE_CCACHE AND WIN32)
message(STATUS "ccache disabled: not supported for the MSVC toolchain on Windows")
endif()
if(WIN32 OR USE_VCPKG)
if(WIN32 OR USE_VCPKG) # Windows (including 64bit) or USE_VCPKG set
# Use vcpkg toolchain on Windows (and on macOS in CI)
set(CMAKE_TOOLCHAIN_FILE
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
CACHE STRING "Vcpkg toolchain file"
CACHE FILEPATH "Vcpkg toolchain file"
)
# Qt path set by user or env var
if(QTDIR
OR DEFINED ENV{QTDIR}
OR DEFINED ENV{QTDIR32}
OR DEFINED ENV{QTDIR64}
)
else()
set(QTDIR
""
CACHE PATH "Path to Qt (e.g. C:/Qt/6.4.2/msvc2019_64)"
)
message(
WARNING
"QTDIR variable is missing. Please set this variable to specify path to Qt (e.g. C:/Qt/6.4.2/msvc2019_64)"
)
endif()
endif()
# A project name is needed for CPack
@ -93,7 +75,7 @@ if(NOT DEFINED GIT_TAG_RELEASENAME)
set(GIT_TAG_RELEASENAME "Graduation Day")
endif()
# Use c++20 for all targets
# Use C++20 for all targets
set(CMAKE_CXX_STANDARD
20
CACHE STRING "C++ ISO Standard"
@ -107,6 +89,8 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
set(COCKATRICE_CMAKE_PATH "${PROJECT_SOURCE_DIR}/cmake")
list(INSERT CMAKE_MODULE_PATH 0 "${COCKATRICE_CMAKE_PATH}")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
include(getversion)
# Create a header and a cpp file containing the version hash
@ -114,8 +98,7 @@ include(createversionfile)
# Define a proper install path
if(UNIX)
if(APPLE)
# macOS
if(APPLE) # macOS
# Due to the special bundle structure ignore
# the prefix eventually set by the user.
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/release)
@ -135,8 +118,7 @@ if(UNIX)
set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/launch-c")
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/launch-cxx")
endif()
else()
# Linux / BSD
else() # Linux / BSD
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
#fix package build
if(PREFIX)
@ -146,7 +128,7 @@ if(UNIX)
endif()
endif()
endif()
elseif(WIN32)
elseif(WIN32) # Windows (including 64bit)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/rundir/${CMAKE_BUILD_TYPE})
endif()
@ -163,7 +145,7 @@ if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
add_compile_definitions(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING)
elseif(CMAKE_COMPILER_IS_GNUCXX)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# linux/gcc, bsd/gcc, windows/mingw
include(CheckCXXCompilerFlag)
@ -218,30 +200,15 @@ endif()
find_package(Threads REQUIRED)
# Determine 32 or 64 bit build
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
endif()
if(DEFINED QTDIR${_lib_suffix})
list(APPEND CMAKE_PREFIX_PATH "${QTDIR${_lib_suffix}}")
elseif(DEFINED QTDIR)
list(APPEND CMAKE_PREFIX_PATH "${QTDIR}")
elseif(DEFINED ENV{QTDIR${_lib_suffix}})
list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR${_lib_suffix}}")
elseif(DEFINED ENV{QTDIR})
list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR}")
endif()
message(STATUS "Update Translations: ${UPDATE_TRANSLATIONS}")
# Find Qt, minimum version is defined in cmake/FindQtRuntime.cmake
include(FindQtRuntime)
set(CMAKE_AUTOMOC TRUE)
# Find other needed libraries
## Find other needed libraries
# Find Protobuf
find_package(Protobuf CONFIG)
if(NOT Protobuf_FOUND)
find_package(Protobuf REQUIRED)
@ -251,7 +218,7 @@ if(${Protobuf_VERSION} VERSION_LESS "3.21.0.0" AND NOT EXISTS "${Protobuf_PROTOC
message(FATAL_ERROR "No protoc command found!")
endif()
#Find OpenSSL
# Find OpenSSL
if(WIN32)
find_package(OpenSSL REQUIRED)
if(OPENSSL_FOUND)
@ -259,7 +226,7 @@ if(WIN32)
endif()
endif()
#Find VCredist
# Find VCredist
if(MSVC)
find_package(VCredistRuntime)
endif()
@ -278,7 +245,7 @@ set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_VERSION_FILENAME}")
if(UNIX)
if(APPLE)
if(APPLE) # macOS
set(CPACK_GENERATOR DragNDrop ${CPACK_GENERATOR})
set(CPACK_GENERATOR "DragNDrop")
set(CPACK_DMG_FORMAT "UDBZ")
@ -288,8 +255,7 @@ if(UNIX)
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/CMakeDMGSetup.script")
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/dmgBackground.tif")
set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/SignMacApplications.cmake")
else()
# linux
else() # Linux
if(CPACK_GENERATOR STREQUAL "RPM")
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
set(CPACK_RPM_MAIN_COMPONENT "cockatrice")
@ -315,7 +281,7 @@ if(UNIX)
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "libqt6sql6-mysql") # for connecting servatrice to a mysql db
endif()
endif()
elseif(WIN32)
elseif(WIN32) # Windows (including 64bit)
set(CPACK_GENERATOR NSIS ${CPACK_GENERATOR})
if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "(x64)")
set(TRICE_IS_64_BIT 1)
@ -372,7 +338,4 @@ if(TEST)
add_subdirectory(tests)
endif()
if(Qt6_FOUND AND Qt6_VERSION_MINOR GREATER_EQUAL 3)
# Qt6.3+ requires project finalization to support translations
qt6_finalize_project()
endif()
qt6_finalize_project()

View file

@ -1,88 +1,173 @@
# FindQtRuntime.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
#
# Inputs:
# WITH_CLIENT
# WITH_ORACLE
# WITH_SERVER
# TEST
#
# Outputs:
# QT_MAIN_VERSION_STRING
# QT_CORE_MODULE
# QT_MODULES_COCKATRICE
# QT_MODULES_ORACLE
# QT_MODULES_SERVATRICE
# QT_MODULES_TEST
# QT_LIBRARY_DIR
# QT_PLUGINS_DIR
# ---------------------------------------------------------------------------
# Define the Qt components required by each target
# ---------------------------------------------------------------------------
set(QT_COMPONENTS_COCKATRICE
Concurrent
Gui
Multimedia
Network
PrintSupport
ShaderTools
Svg
WebSockets
Widgets
Xml
Quick
QuickWidgets
)
set(QT_COMPONENTS_ORACLE Concurrent Network Svg Widgets Xml)
set(QT_COMPONENTS_SERVATRICE Network Sql WebSockets)
# 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 instead to tests/CMakeLists.txt.
set(QT_COMPONENTS_TEST Concurrent Network Svg Widgets)
# ---------------------------------------------------------------------------
# Determine which Qt components are required for this build
# ---------------------------------------------------------------------------
set(QT_COMPONENTS_REQUIRED Core)
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
)
list(APPEND QT_COMPONENTS_REQUIRED ${QT_COMPONENTS_COCKATRICE})
endif()
if(WITH_ORACLE)
set(_ORACLE_NEEDED Concurrent Network Svg Widgets Xml)
list(APPEND QT_COMPONENTS_REQUIRED ${QT_COMPONENTS_ORACLE})
endif()
if(WITH_SERVER)
list(APPEND QT_COMPONENTS_REQUIRED ${QT_COMPONENTS_SERVATRICE})
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)
list(APPEND QT_COMPONENTS_REQUIRED ${QT_COMPONENTS_TEST})
endif()
set(REQUIRED_QT_COMPONENTS ${REQUIRED_QT_COMPONENTS} ${_SERVATRICE_NEEDED} ${_COCKATRICE_NEEDED} ${_ORACLE_NEEDED}
${_TEST_NEEDED}
)
list(REMOVE_DUPLICATES REQUIRED_QT_COMPONENTS)
list(REMOVE_DUPLICATES QT_COMPONENTS_REQUIRED)
# 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)
# ---------------------------------------------------------------------------
# Find Qt and define minimum version centrally
# ---------------------------------------------------------------------------
list(FIND Qt6LinguistTools_TARGETS Qt6::lrelease QT6_LRELEASE_INDEX)
if(QT6_LRELEASE_INDEX EQUAL -1)
# Add Qt Linguist as required component unrelated of build target
find_package(Qt6 6.4 REQUIRED COMPONENTS ${QT_COMPONENTS_REQUIRED} LinguistTools)
set(QT_MAIN_VERSION_STRING Qt6)
# ---------------------------------------------------------------------------
# Qt Linguist tools
# ---------------------------------------------------------------------------
if(TARGET Qt6::lrelease)
set(QT6_LRELEASE_INDEX 0)
else()
message(WARNING "Qt6 lrelease not found.")
endif()
list(FIND Qt6LinguistTools_TARGETS Qt6::lupdate QT6_LUPDATE_INDEX)
if(QT6_LUPDATE_INDEX EQUAL -1)
if(TARGET Qt6::lupdate)
set(QT6_LUPDATE_INDEX 0)
else()
message(WARNING "Qt6 lupdate not found.")
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# ---------------------------------------------------------------------------
# Export Qt target lists for individual targets
# ---------------------------------------------------------------------------
# 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)
# Convert components list into Qt modules, e.g.
# Network;Sql;WebSockets --> Qt6::Network;Qt6::Sql;Qt6::WebSockets
function(_qt_components_to_targets COMPONENTS OUTPUT_VARIABLE)
set(TARGETS)
foreach(COMPONENT IN LISTS COMPONENTS)
list(APPEND TARGETS "${QT_MAIN_VERSION_STRING}::${COMPONENT}")
endforeach()
set(${OUTPUT_VARIABLE}
"${TARGETS}"
PARENT_SCOPE
)
endfunction()
if(WITH_CLIENT)
_qt_components_to_targets("${QT_COMPONENTS_COCKATRICE}" QT_MODULES_COCKATRICE)
endif()
if(WITH_ORACLE)
_qt_components_to_targets("${QT_COMPONENTS_ORACLE}" QT_MODULES_ORACLE)
endif()
if(WITH_SERVER)
_qt_components_to_targets("${QT_COMPONENTS_SERVATRICE}" QT_MODULES_SERVATRICE)
endif()
if(TEST)
_qt_components_to_targets("${QT_COMPONENTS_TEST}" QT_MODULES_TEST)
endif()
# Core-only export (useful for headless libraries)
set(QT_CORE_MODULE "${QT_MAIN_VERSION_STRING}::Core")
# ---------------------------------------------------------------------------
# Qt runtime library & plugin paths
# ---------------------------------------------------------------------------
if(NOT TARGET "${QT_CORE_MODULE}")
message(FATAL_ERROR "${QT_CORE_MODULE} target is not available")
endif()
get_target_property(QT_LIBRARY_DIR "${QT_CORE_MODULE}" LOCATION)
get_filename_component(QT_LIBRARY_DIR "${QT_LIBRARY_DIR}" DIRECTORY)
get_filename_component(QT_LIBRARY_DIR "${QT_LIBRARY_DIR}/../../.." ABSOLUTE)
get_filename_component(QT_PLUGINS_DIR "${Qt6Core_DIR}/../../../${QT6_INSTALL_PLUGINS}" ABSOLUTE)
if(UNIX AND APPLE)
# Mac needs a bit more help finding all necessary components
# macOS needs a bit more help finding all necessary components
list(APPEND QT_LIBRARY_DIR "/usr/local/lib")
endif()
# ---------------------------------------------------------------------------
# Debug information
# ---------------------------------------------------------------------------
message(STATUS "Found Qt: ${Qt6_DIR} (found version \"${Qt6_VERSION}\")")
message(STATUS "QT_COMPONENTS_REQUIRED = ${QT_COMPONENTS_REQUIRED}")
if(WITH_CLIENT)
message(STATUS "QT_MODULES_COCKATRICE = ${QT_MODULES_COCKATRICE}")
endif()
if(WITH_ORACLE)
message(STATUS "QT_MODULES_ORACLE = ${QT_MODULES_ORACLE}")
endif()
if(WITH_SERVER)
message(STATUS "QT_MODULES_SERVATRICE = ${QT_MODULES_SERVATRICE}")
endif()
if(TEST)
message(STATUS "QT_MODULES_TEST = ${QT_MODULES_TEST}")
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}")

View file

@ -1,16 +1,13 @@
# Find the MS Visual Studio VC redistributable package
if(WIN32)
if(WIN32) # Windows (including 64bit)
set(VCREDISTRUNTIME_FOUND "NO")
if(CMAKE_SIZEOF_VOID_P EQUAL 8) # 64-bit
set(REDIST_ARCH x64)
else()
set(REDIST_ARCH x86)
endif()
# VS 2017 uses vcredist_ARCH.exe, VS 2022 uses vc_redist.ARCH.exe
set(REDIST_FILE_NAMES vcredist_${REDIST_ARCH}.exe vcredist.${REDIST_ARCH}.exe vc_redist.${REDIST_ARCH}.exe)
set(REDIST_FILE_NAMES vc_redist.${REDIST_ARCH}.exe)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include(InstallRequiredSystemLibraries)

View file

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.16)
project(gtest-download LANGUAGES NONE)

View file

@ -1,12 +1,12 @@
# CMakeLists for cockatrice directory
#
# provides the cockatrice binary
# Provides the cockatrice binary
project(Cockatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(cockatrice_SOURCES
${VERSION_STRING_CPP}
# sort by alphabetical order, so that there is no debate about where to add new sources to the list
# Sort by alphabetical order, so that there is no debate about where to add new sources to the list
src/client/network/connection_controller/remote_connection_controller.cpp
src/client/network/update/client/update_downloader.cpp
src/client/network/interfaces/deck_stats_interface.cpp
@ -477,7 +477,7 @@ else()
file(GLOB cockatrice_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts")
endif()
if(WIN32)
if(WIN32) # Windows (including 64bit)
set(cockatrice_SOURCES ${cockatrice_SOURCES} cockatrice.rc)
endif(WIN32)
@ -555,7 +555,7 @@ target_link_libraries(
libcockatrice_models
libcockatrice_rng
libcockatrice_settings
${COCKATRICE_QT_MODULES}
${QT_MODULES_COCKATRICE}
)
if(UNIX)
@ -571,7 +571,7 @@ if(UNIX)
install(TARGETS cockatrice BUNDLE DESTINATION ./)
else()
# Assume linux
# Assume Linux
install(TARGETS cockatrice RUNTIME DESTINATION bin/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.png DESTINATION ${ICONDIR}/hicolor/48x48/apps)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps)
@ -599,11 +599,11 @@ elseif(WIN32)
endif()
if(APPLE)
# these needs to be relative to CMAKE_INSTALL_PREFIX
# These needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir cockatrice.app/Contents/Plugins)
set(qtconf_dest_dir cockatrice.app/Contents/Resources)
# Qt plugins: audio, iconengines, imageformats, multimedia, platforms, printsupport, styles, tls
# Qt plugins: iconengines, imageformats, multimedia, platforms, styles, tls
install(
DIRECTORY "${QT_PLUGINS_DIR}/"
DESTINATION ${plugin_dest_dir}
@ -611,12 +611,10 @@ if(APPLE)
FILES_MATCHING
PATTERN "*.dSYM" EXCLUDE
PATTERN "*_debug.dylib" EXCLUDE
PATTERN "audio/*.dylib"
PATTERN "iconengines/*.dylib"
PATTERN "imageformats/*.dylib"
PATTERN "multimedia/*.dylib"
PATTERN "platforms/*.dylib"
PATTERN "printsupport/*.dylib"
PATTERN "styles/*.dylib"
PATTERN "tls/*.dylib"
)
@ -650,8 +648,8 @@ Data = Resources\")
)
endif()
if(WIN32)
# these needs to be relative to CMAKE_INSTALL_PREFIX
if(WIN32) # Windows (including 64bit)
# These needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir Plugins)
set(qtconf_dest_dir .)
@ -670,14 +668,12 @@ if(WIN32)
PATTERN "*.ini"
)
# Qt plugins: audio, iconengines, imageformats, multimedia, platforms, printsupport, styles, tls
# Qt plugins: iconengines, imageformats, multimedia, platforms, styles, tls
install(
DIRECTORY "${QT_PLUGINS_DIR}/"
DESTINATION ${plugin_dest_dir}
COMPONENT Runtime
FILES_MATCHING
PATTERN "audio/qtaudio_wasapi.dll"
PATTERN "audio/qtaudio_windows.dll"
PATTERN "iconengines/qsvgicon.dll"
PATTERN "imageformats/*.dll"
PATTERN "mediaservice/dsengine.dll"
@ -687,7 +683,6 @@ if(WIN32)
PATTERN "platforms/qminimal.dll"
PATTERN "platforms/qoffscreen.dll"
PATTERN "platforms/qwindows.dll"
PATTERN "printsupport/windowsprintersupport.dll"
PATTERN "styles/qcertonlybackend.dll"
PATTERN "styles/qopensslbackend.dll"
PATTERN "styles/qschannelbackend.dll"

View file

@ -1,6 +1,6 @@
# CMakeLists for sounds directory
#
# add sounds subfolders
# Add sounds subfolders
set(defsounds Default Legacy)
@ -8,9 +8,9 @@ if(UNIX)
if(APPLE)
install(DIRECTORY ${defsounds} DESTINATION Cockatrice.app/Contents/Resources/sounds/)
else()
# Assume linux
# Assume Linux
install(DIRECTORY ${defsounds} DESTINATION share/cockatrice/sounds/)
endif()
elseif(WIN32)
elseif(WIN32) # Windows (including 64bit)
install(DIRECTORY ${defsounds} DESTINATION sounds/)
endif()

View file

@ -74,9 +74,7 @@ bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
return rel_maj == sys_maj;
#elif defined(Q_OS_WIN)
#if Q_PROCESSOR_WORDSIZE == 4
return fileName.contains("32bit");
#elif Q_PROCESSOR_WORDSIZE == 8
#if Q_PROCESSOR_WORDSIZE == 8 // 64-bit
const QString &version = QSysInfo::productVersion();
if (version.startsWith("7") || version.startsWith("8")) {
return fileName.contains("Win7");

View file

@ -16,7 +16,6 @@ class CardInfo;
class AbstractCardDragItem : public QObject, public QGraphicsItem
{
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
protected:
AbstractCardItem *item;
QPointF hotSpot;

View file

@ -23,7 +23,6 @@ class QString;
class AbstractCounter : public QObject, public QGraphicsItem, public AbstractPlayerComponent
{
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
protected:
PlayerLogic *player;

View file

@ -19,7 +19,6 @@ class PlayerLogic;
class ArrowItem : public QObject, public QGraphicsItem, public IAnimatedItem
{
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
signals:
void requestDeletion(int creatorId, int id);

View file

@ -27,7 +27,6 @@ class GameCommand;
class PhaseButton : public QObject, public QGraphicsItem
{
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
private:
QString name;
bool active, highlightable;
@ -65,7 +64,6 @@ protected:
class PhasesToolbar : public QObject, public QGraphicsItem
{
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
private:
QList<PhaseButton *> buttonList;
PhaseButton *nextTurnButton;

View file

@ -16,7 +16,6 @@
class PlayerArea : public QObject, public QGraphicsItem
{
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
private:
QRectF bRect;
int playerZoneId;

View file

@ -34,7 +34,6 @@ class QGraphicsSceneWheelEvent;
class ZoneViewZone : public SelectZone, public QGraphicsLayoutItem
{
Q_OBJECT
Q_INTERFACES(QGraphicsLayoutItem)
private:
static constexpr int HORIZONTAL_PADDING = 12;
static constexpr int VERTICAL_PADDING = 5;

View file

@ -13,12 +13,10 @@
#include <QTextStream>
#include <QVector>
#if defined(Q_PROCESSOR_X86_32)
#define BUILD_ARCHITECTURE "32-bit"
#elif defined(Q_PROCESSOR_X86_64)
#define BUILD_ARCHITECTURE "64-bit"
#if defined(Q_PROCESSOR_X86)
#define BUILD_ARCHITECTURE "x64"
#elif defined(Q_PROCESSOR_ARM)
#define BUILD_ARCHITECTURE "ARM"
#define BUILD_ARCHITECTURE "arm64"
#else
#define BUILD_ARCHITECTURE "unknown"
#endif

View file

@ -633,23 +633,13 @@ void ChatView::showSystemPopup(const QString &userName)
QColor ChatView::getCustomMentionColor()
{
#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
QColor customColor = QColor::fromString("#" + SettingsCache::instance().chat().getChatMentionColor());
#else
QColor customColor;
customColor.setNamedColor("#" + SettingsCache::instance().chat().getChatMentionColor());
#endif
return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR;
}
QColor ChatView::getCustomHighlightColor()
{
#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
QColor customColor = QColor::fromString("#" + SettingsCache::instance().chat().getChatMentionColor());
#else
QColor customColor;
customColor.setNamedColor("#" + SettingsCache::instance().chat().getChatMentionColor());
#endif
return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR;
}

View file

@ -780,6 +780,7 @@ void UserInfoPopup::enterEvent(QEnterEvent *e)
QFrame::enterEvent(e);
emit mouseEnteredPopup();
}
void UserInfoPopup::leaveEvent(QEvent *e)
{
QFrame::leaveEvent(e);

View file

@ -151,12 +151,7 @@ MessagesSettingsPage::MessagesSettingsPage()
void MessagesSettingsPage::updateColor(const QString &value)
{
#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
QColor colorToSet = QColor::fromString("#" + value);
#else
QColor colorToSet;
colorToSet.setNamedColor("#" + value);
#endif
if (colorToSet.isValid()) {
SettingsCache::instance().chat().setChatMentionColor(value);
updateMentionPreview();
@ -165,12 +160,7 @@ void MessagesSettingsPage::updateColor(const QString &value)
void MessagesSettingsPage::updateHighlightColor(const QString &value)
{
#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
QColor colorToSet = QColor::fromString("#" + value);
#else
QColor colorToSet;
colorToSet.setNamedColor("#" + value);
#endif
if (colorToSet.isValid()) {
SettingsCache::instance().chat().setChatHighlightColor(value);
updateHighlightPreview();

View file

@ -97,7 +97,6 @@ public slots:
protected:
void mousePressEvent(QMouseEvent *event) override;
void enterEvent(QEnterEvent *event) override; ///< Hover enter
void leaveEvent(QEvent *event) override;

View file

@ -38,7 +38,6 @@ private:
protected slots:
void mousePressEvent(QMouseEvent *event) override;
void enterEvent(QEnterEvent *event) override; ///< Hover enter
void leaveEvent(QEvent *event) override;
};

View file

@ -57,7 +57,7 @@ QRect MacOSTabFixStyle::subElementRect(SubElement element, const QStyleOption *o
}
// Skip over QProxyStyle handling subElementRect,
// This fixes an issue on OSX where the labels for tabs with a button and an icon
// This fixes an issue on macOS where the labels for tabs with a button and an icon
// get cut-off too early
return QCommonStyle::subElementRect(element, option, widget);
}

View file

@ -1,6 +1,6 @@
# CMakeLists for themes directory
#
# add themes subfolders
# Add themes subfolders
set(defthemes Fabric Fusion Leather Plasma VelvetMarble System)
@ -8,9 +8,9 @@ if(UNIX)
if(APPLE)
install(DIRECTORY ${defthemes} DESTINATION Cockatrice.app/Contents/Resources/themes/)
else()
# Assume linux
# Assume Linux
install(DIRECTORY ${defthemes} DESTINATION share/cockatrice/themes/)
endif()
elseif(WIN32)
elseif(WIN32) # Windows (including 64bit)
install(DIRECTORY ${defthemes} DESTINATION themes/)
endif()

View file

@ -10,5 +10,5 @@ add_library(libcockatrice_network INTERFACE)
target_include_directories(libcockatrice_network INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(
libcockatrice_network INTERFACE ${COCKATRICE_QT_MODULES} libcockatrice_network_client libcockatrice_network_server
libcockatrice_network INTERFACE ${QT_MODULES_COCKATRICE} libcockatrice_network_client libcockatrice_network_server
)

View file

@ -12,7 +12,7 @@ target_include_directories(libcockatrice_network_client INTERFACE .)
target_link_libraries(
libcockatrice_network_client
INTERFACE ${COCKATRICE_QT_VERSION_NAME}::Network ${COCKATRICE_QT_VERSION_NAME}::WebSockets
INTERFACE ${QT_MAIN_VERSION_STRING}::Network ${QT_MAIN_VERSION_STRING}::WebSockets
libcockatrice_network_client_abstract libcockatrice_network_client_local
libcockatrice_network_client_remote
)

View file

@ -15,7 +15,6 @@ add_dependencies(libcockatrice_network_client_abstract libcockatrice_protocol li
target_include_directories(libcockatrice_network_client_abstract PUBLIC .)
target_link_libraries(
libcockatrice_network_client_abstract
PUBLIC ${COCKATRICE_QT_VERSION_NAME}::Network ${COCKATRICE_QT_VERSION_NAME}::WebSockets libcockatrice_protocol
libcockatrice_network_server_remote
libcockatrice_network_client_abstract PUBLIC ${QT_MAIN_VERSION_STRING}::Network ${QT_MAIN_VERSION_STRING}::WebSockets
libcockatrice_protocol libcockatrice_network_server_remote
)

View file

@ -15,7 +15,6 @@ add_dependencies(libcockatrice_network_client_local libcockatrice_network_client
target_include_directories(libcockatrice_network_client_local PUBLIC .)
target_link_libraries(
libcockatrice_network_client_local
PUBLIC ${COCKATRICE_QT_VERSION_NAME}::Network ${COCKATRICE_QT_VERSION_NAME}::WebSockets
libcockatrice_network_client_abstract
libcockatrice_network_client_local PUBLIC ${QT_MAIN_VERSION_STRING}::Network ${QT_MAIN_VERSION_STRING}::WebSockets
libcockatrice_network_client_abstract
)

View file

@ -16,6 +16,6 @@ target_include_directories(libcockatrice_network_client_remote PUBLIC .)
target_link_libraries(
libcockatrice_network_client_remote
PUBLIC ${COCKATRICE_QT_VERSION_NAME}::Network ${COCKATRICE_QT_VERSION_NAME}::WebSockets
libcockatrice_network_client_abstract libcockatrice_interfaces libcockatrice_utility libcockatrice_protocol
PUBLIC ${QT_MAIN_VERSION_STRING}::Network ${QT_MAIN_VERSION_STRING}::WebSockets libcockatrice_network_client_abstract
libcockatrice_interfaces libcockatrice_utility libcockatrice_protocol
)

View file

@ -10,6 +10,6 @@ add_library(libcockatrice_network_server INTERFACE)
target_include_directories(libcockatrice_network_server INTERFACE .)
target_link_libraries(
libcockatrice_network_server INTERFACE ${COCKATRICE_QT_MODULES} libcockatrice_network_server_local
libcockatrice_network_server INTERFACE ${QT_MODULES_COCKATRICE} libcockatrice_network_server_local
libcockatrice_network_server_remote
)

View file

@ -14,4 +14,4 @@ add_dependencies(libcockatrice_network_server_local libcockatrice_protocol)
target_include_directories(libcockatrice_network_server_local PUBLIC .)
target_link_libraries(libcockatrice_network_server_local PUBLIC ${COCKATRICE_QT_MODULES} libcockatrice_protocol)
target_link_libraries(libcockatrice_network_server_local PUBLIC ${QT_MODULES_COCKATRICE} libcockatrice_protocol)

View file

@ -60,5 +60,5 @@ target_include_directories(libcockatrice_network_server_remote PUBLIC .)
# Make cockatrice_server depend on cockatrice_protocol
target_link_libraries(
libcockatrice_network_server_remote PUBLIC libcockatrice_protocol libcockatrice_utility libcockatrice_rng
libcockatrice_deck_list ${COCKATRICE_QT_MODULES}
libcockatrice_deck_list ${QT_MODULES_COCKATRICE}
)

View file

@ -39,5 +39,3 @@ find_package(OpenSSL REQUIRED)
target_link_libraries(libcockatrice_utility PUBLIC libcockatrice_rng OpenSSL::Crypto ${QT_CORE_MODULE})
set(ORACLE_LIBS)
include_directories(${${COCKATRICE_QT_VERSION_NAME}Core_INCLUDE_DIRS})

View file

@ -48,7 +48,7 @@ else()
file(GLOB oracle_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts")
endif(UPDATE_TRANSLATIONS)
if(WIN32)
if(WIN32) # Windows (including 64bit)
set(oracle_SOURCES ${oracle_SOURCES} oracle.rc)
endif(WIN32)
@ -98,7 +98,6 @@ endif()
# ------------------------
# Build executable
# ------------------------
set(ORACLE_MAC_QM_INSTALL_DIR "oracle.app/Contents/Resources/translations")
set(ORACLE_UNIX_QM_INSTALL_DIR "share/oracle/translations")
set(ORACLE_WIN32_QM_INSTALL_DIR "translations")
@ -124,7 +123,7 @@ target_link_libraries(
PUBLIC libcockatrice_card
PUBLIC libcockatrice_settings
PUBLIC libcockatrice_network
PUBLIC ${ORACLE_QT_MODULES}
PUBLIC ${QT_MODULES_ORACLE}
)
if(ZLIB_FOUND)
@ -150,12 +149,12 @@ if(UNIX)
install(TARGETS oracle BUNDLE DESTINATION ./)
else()
# Assume linux
# Assume Linux
install(TARGETS oracle RUNTIME DESTINATION bin/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/oracle.png DESTINATION ${ICONDIR}/hicolor/48x48/apps)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/oracle.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps)
endif()
elseif(WIN32)
elseif(WIN32) # Windows (including 64bit)
install(TARGETS oracle RUNTIME DESTINATION ./)
endif()
@ -167,7 +166,7 @@ endif(NOT WIN32 AND NOT APPLE)
# Qt plugin handling
# ------------------------
if(APPLE)
# these needs to be relative to CMAKE_INSTALL_PREFIX
# These needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir oracle.app/Contents/Plugins)
set(qtconf_dest_dir oracle.app/Contents/Resources)
@ -206,8 +205,8 @@ Translations = Resources/translations\")
)
endif()
if(WIN32)
# these needs to be relative to CMAKE_INSTALL_PREFIX
if(WIN32) # Windows (including 64bit)
# These needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir Plugins)
set(qtconf_dest_dir .)
list(APPEND libSearchDirs ${QT_LIBRARY_DIR})
@ -285,7 +284,7 @@ if(Qt6LinguistTools_FOUND)
else()
install(FILES ${oracle_QM} DESTINATION ${ORACLE_UNIX_QM_INSTALL_DIR})
endif()
elseif(WIN32)
elseif(WIN32) # Windows (including 64bit)
install(FILES ${oracle_QM} DESTINATION ${ORACLE_WIN32_QM_INSTALL_DIR})
endif()
endif()

View file

@ -1,6 +1,6 @@
# CMakeLists for servatrice directory
#
# provides the servatrice binary
# Provides the servatrice binary
project(Servatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
@ -27,7 +27,7 @@ set(servatrice_SOURCES
set(servatrice_RESOURCES servatrice.qrc)
if(WIN32)
if(WIN32) # Windows (including 64bit)
set(servatrice_SOURCES ${servatrice_SOURCES} servatrice.rc)
endif(WIN32)
@ -49,14 +49,14 @@ qt6_add_resources(servatrice_RESOURCES_RCC ${servatrice_RESOURCES})
set(QT_DONT_USE_QTGUI TRUE)
# Mysql connector
# MySQL connector
if(UNIX)
if(APPLE)
set(MYSQLCLIENT_DEFAULT_PATHS "/usr/local/lib" "/opt/local/lib/mysql55/mysql/" "/opt/local/lib/mysql56/mysql/")
else()
set(MYSQLCLIENT_DEFAULT_PATHS "/usr/lib64" "/usr/local/lib64" "/usr/lib" "/usr/local/lib")
endif()
elseif(WIN32)
elseif(WIN32) # Windows (including 64bit)
set(MYSQLCLIENT_DEFAULT_PATHS "C:\\Program Files\\MySQL\\MySQL Server 5.7\\lib"
"C:\\Program Files (x86)\\MySQL\\MySQL Server 5.7\\lib"
)
@ -101,16 +101,16 @@ target_precompile_headers(servatrice PRIVATE "${CMAKE_SOURCE_DIR}/cmake/pch/qtco
if(CMAKE_HOST_SYSTEM MATCHES "FreeBSD")
target_link_libraries(
servatrice libcockatrice_deck_list libcockatrice_network_server_remote Threads::Threads ${SERVATRICE_QT_MODULES}
servatrice libcockatrice_deck_list libcockatrice_network_server_remote Threads::Threads ${QT_MODULES_SERVATRICE}
${LIBEXECINFO_LIBRARY}
)
else()
target_link_libraries(
servatrice libcockatrice_deck_list libcockatrice_network_server_remote Threads::Threads ${SERVATRICE_QT_MODULES}
servatrice libcockatrice_deck_list libcockatrice_network_server_remote Threads::Threads ${QT_MODULES_SERVATRICE}
)
endif()
# install rules
# Install rules
if(UNIX)
if(APPLE)
set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}")
@ -124,7 +124,7 @@ if(UNIX)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION ./servatrice.app/Contents/Resources/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION ./servatrice.app/Contents/Resources/)
else()
# Assume linux
# Assume Linux
install(TARGETS servatrice RUNTIME DESTINATION bin/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION share/servatrice/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION share/servatrice/)
@ -133,14 +133,14 @@ if(UNIX)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/servatrice.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.desktop DESTINATION ${DESKTOPDIR})
endif()
elseif(WIN32)
elseif(WIN32) # Windows (including 64bit)
install(TARGETS servatrice RUNTIME DESTINATION ./)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION ./)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION ./)
endif()
if(APPLE)
# these needs to be relative to CMAKE_INSTALL_PREFIX
# These needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir servatrice.app/Contents/Plugins)
set(qtconf_dest_dir servatrice.app/Contents/Resources)
@ -178,8 +178,8 @@ Translations = Resources/translations\")
)
endif()
if(WIN32)
# these needs to be relative to CMAKE_INSTALL_PREFIX
if(WIN32) # Windows (including 64bit)
# These needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir Plugins)
set(qtconf_dest_dir .)

View file

@ -167,11 +167,7 @@ bool QxtHmac::verify(const QByteArray& otherInner)
void QxtHmac::addData(const char* data, int length)
{
Q_ASSERT(qxt_d().opad.size());
#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0))
qxt_d().ihash->addData(QByteArrayView(data, length));
#else
qxt_d().ihash->addData(data, length);
#endif
qxt_d().result.clear();
}

View file

@ -1,4 +1,4 @@
# NOTE: Qt modules for tests are defined centrally in cmake/FindQtRuntime.cmake (the _TEST_NEEDED variable).
# NOTE: Qt modules for tests are defined centrally in cmake/FindQtRuntime.cmake (QT_COMPONENTS_TEST variable).
# If a new test needs additional Qt modules, add them there — not in individual test CMakeLists.txt files.
enable_testing()
@ -22,8 +22,6 @@ add_test(NAME loader_local_matching_test COMMAND loader_local_matching_test)
add_test(NAME deck_hash_performance_test COMMAND deck_hash_performance_test)
set_tests_properties(deck_hash_performance_test PROPERTIES TIMEOUT 15)
# Find GTest
add_executable(dummy_test dummy_test.cpp)
add_executable(expression_test expression_test.cpp)
add_executable(clamped_arithmetic_test clamped_arithmetic_test.cpp)
@ -53,6 +51,7 @@ add_executable(
)
target_include_directories(loader_local_matching_test PRIVATE ${CMAKE_SOURCE_DIR}/cockatrice/src)
# Find GTest
find_package(GTest)
if(NOT GTEST_FOUND)
@ -99,52 +98,52 @@ endif()
include_directories(${GTEST_INCLUDE_DIRS})
target_link_libraries(dummy_test Threads::Threads ${GTEST_BOTH_LIBRARIES})
target_link_libraries(expression_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES})
target_link_libraries(expression_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST})
target_link_libraries(
clamped_arithmetic_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
clamped_arithmetic_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
target_link_libraries(
test_age_formatting libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
test_age_formatting libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
target_link_libraries(
password_hash_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
password_hash_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
target_link_libraries(
playmat_resolver_test libcockatrice_deck_list libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES}
${TEST_QT_MODULES}
${QT_MODULES_TEST}
)
target_link_libraries(
deck_hash_performance_test libcockatrice_deck_list libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES}
${TEST_QT_MODULES}
${QT_MODULES_TEST}
)
target_link_libraries(
server_card_counter_test libcockatrice_network Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
server_card_counter_test libcockatrice_network Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
target_link_libraries(
server_counter_test libcockatrice_network Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
)
target_link_libraries(
server_rate_limiter_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
server_counter_test libcockatrice_network Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
target_link_libraries(
server_developer_role_test libcockatrice_network libcockatrice_rng Threads::Threads ${GTEST_BOTH_LIBRARIES}
${TEST_QT_MODULES}
${QT_MODULES_TEST}
)
target_link_libraries(
server_rate_limiter_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
target_link_libraries(
server_game_join_test libcockatrice_network_server_remote libcockatrice_rng Threads::Threads ${GTEST_BOTH_LIBRARIES}
${TEST_QT_MODULES}
${QT_MODULES_TEST}
)
target_link_libraries(
warning_categories_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
warning_categories_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
target_link_libraries(lag_monitor_test Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES})
target_link_libraries(lag_monitor_test Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST})
target_link_libraries(
latency_tracker_test libcockatrice_network Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
latency_tracker_test libcockatrice_network Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
target_include_directories(metrics_registry_test PRIVATE ${CMAKE_SOURCE_DIR}/servatrice/src)
target_link_libraries(metrics_registry_test ${TEST_QT_MODULES} Threads::Threads ${GTEST_BOTH_LIBRARIES})
target_link_libraries(metrics_registry_test Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST})
target_link_libraries(
loader_local_matching_test libcockatrice_settings Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
loader_local_matching_test libcockatrice_settings Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
add_subdirectory(card_zone_algorithms)

View file

@ -16,7 +16,7 @@ target_link_libraries(
PRIVATE libcockatrice_card
PRIVATE Threads::Threads
PRIVATE ${GTEST_BOTH_LIBRARIES}
PRIVATE ${TEST_QT_MODULES}
PRIVATE ${QT_MODULES_TEST}
)
add_test(NAME carddatabase_test COMMAND carddatabase_test)
@ -32,7 +32,7 @@ target_link_libraries(
PRIVATE libcockatrice_models
PRIVATE Threads::Threads
PRIVATE ${GTEST_BOTH_LIBRARIES}
PRIVATE ${TEST_QT_MODULES}
PRIVATE ${QT_MODULES_TEST}
)
if(NOT GTEST_FOUND)
@ -51,7 +51,7 @@ if(WITH_ORACLE OR WITH_CLIENT)
PRIVATE libcockatrice_filters
PRIVATE Threads::Threads
PRIVATE ${GTEST_BOTH_LIBRARIES}
PRIVATE ${TEST_QT_MODULES}
PRIVATE ${QT_MODULES_TEST}
)
add_test(NAME filter_string_test COMMAND filter_string_test)

View file

@ -11,7 +11,7 @@ target_link_libraries(
libcockatrice_deck_list
Threads::Threads
${GTEST_BOTH_LIBRARIES}
${TEST_QT_MODULES}
${QT_MODULES_TEST}
)
add_test(NAME deck_list_model_custom_zones_test COMMAND deck_list_model_custom_zones_test)
@ -28,6 +28,6 @@ target_link_libraries(
libcockatrice_deck_list
Threads::Threads
${GTEST_BOTH_LIBRARIES}
${TEST_QT_MODULES}
${QT_MODULES_TEST}
)
add_test(NAME deck_list_model_zone_integration_test COMMAND deck_list_model_zone_integration_test)

View file

@ -5,6 +5,6 @@ if(NOT GTEST_FOUND)
endif()
target_link_libraries(
deck_list_zones_test libcockatrice_deck_list Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
deck_list_zones_test libcockatrice_deck_list Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
add_test(NAME deck_list_zones_test COMMAND deck_list_zones_test)

View file

@ -7,6 +7,6 @@ endif()
target_link_libraries(
loading_from_clipboard_test libcockatrice_deck_list libcockatrice_card Threads::Threads ${GTEST_BOTH_LIBRARIES}
${TEST_QT_MODULES}
${QT_MODULES_TEST}
)
add_test(NAME loading_from_clipboard_test COMMAND loading_from_clipboard_test)

View file

@ -10,7 +10,7 @@ target_link_libraries(
PRIVATE libcockatrice_rng
PRIVATE Threads::Threads
PRIVATE ${GTEST_BOTH_LIBRARIES}
PRIVATE ${TEST_QT_MODULES}
PRIVATE ${QT_MODULES_TEST}
)
add_test(NAME reverse_card_move_test COMMAND reverse_card_move_test)

View file

@ -4,7 +4,7 @@ if(NOT GTEST_FOUND)
add_dependencies(parse_cipt_test gtest)
endif()
target_link_libraries(parse_cipt_test Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES})
target_link_libraries(parse_cipt_test Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST})
add_test(NAME parse_cipt_test COMMAND parse_cipt_test)
@ -20,7 +20,7 @@ endif()
target_link_libraries(
oracle_importer_test libcockatrice_card libcockatrice_interfaces Threads::Threads ${GTEST_BOTH_LIBRARIES}
${TEST_QT_MODULES}
${QT_MODULES_TEST}
)
add_test(NAME oracle_importer_test COMMAND oracle_importer_test)
@ -64,6 +64,6 @@ target_link_libraries(
libcockatrice_interfaces
Threads::Threads
${GTEST_BOTH_LIBRARIES}
${TEST_QT_MODULES}
${QT_MODULES_TEST}
${_ORACLE_BENCH_EXTRA_LIBRARIES}
)

View file

@ -3,16 +3,16 @@ add_executable(settings_defaults_test settings_defaults_test.cpp)
add_executable(settings_migration_test settings_migration_test.cpp)
target_link_libraries(
settings_manager_test libcockatrice_settings Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
settings_manager_test libcockatrice_settings Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
target_link_libraries(
settings_defaults_test libcockatrice_settings Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
settings_defaults_test libcockatrice_settings Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
target_compile_definitions(settings_defaults_test PRIVATE SETTINGS_UNIT_TEST)
target_link_libraries(
settings_migration_test libcockatrice_settings Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES}
settings_migration_test libcockatrice_settings Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
)
add_test(NAME settings_manager_test COMMAND settings_manager_test)