Compare commits

...

2 commits

Author SHA1 Message Date
tooomm
5d65adfc9c revert nsis changes 2026-09-09 23:50:10 +02:00
tooomm
c892f7fc46 fix Qt variable name 2026-09-09 23:15:08 +02:00
22 changed files with 195 additions and 148 deletions

View file

@ -41,37 +41,40 @@ set(QT_COMPONENTS_ORACLE Concurrent Network Svg Widgets)
set(QT_COMPONENTS_SERVATRICE Network Sql WebSockets) 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) set(QT_COMPONENTS_TEST Concurrent Network Svg Widgets)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Determine which Qt components are required for this build # Determine which Qt components are required for this build
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
set(REQUIRED_QT_COMPONENTS Core) set(QT_COMPONENTS_REQUIRED Core)
if(WITH_CLIENT) if(WITH_CLIENT)
list(APPEND REQUIRED_QT_COMPONENTS ${QT_COMPONENTS_COCKATRICE}) list(APPEND QT_COMPONENTS_REQUIRED ${QT_COMPONENTS_COCKATRICE})
endif() endif()
if(WITH_ORACLE) if(WITH_ORACLE)
list(APPEND REQUIRED_QT_COMPONENTS ${QT_COMPONENTS_ORACLE}) list(APPEND QT_COMPONENTS_REQUIRED ${QT_COMPONENTS_ORACLE})
endif() endif()
if(WITH_SERVER) if(WITH_SERVER)
list(APPEND REQUIRED_QT_COMPONENTS ${QT_COMPONENTS_SERVATRICE}) list(APPEND QT_COMPONENTS_REQUIRED ${QT_COMPONENTS_SERVATRICE})
endif() endif()
if(TEST) if(TEST)
list(APPEND REQUIRED_QT_COMPONENTS ${QT_COMPONENTS_TEST}) list(APPEND QT_COMPONENTS_REQUIRED ${QT_COMPONENTS_TEST})
endif() endif()
list(REMOVE_DUPLICATES REQUIRED_QT_COMPONENTS) list(REMOVE_DUPLICATES QT_COMPONENTS_REQUIRED)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Find Qt and define minimum version centrally # Find Qt and define minimum version centrally
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
find_package(Qt6 6.4 REQUIRED COMPONENTS ${REQUIRED_QT_COMPONENTS} LinguistTools) # 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) set(QT_MAIN_VERSION_STRING Qt6)
@ -92,10 +95,11 @@ else()
endif() endif()
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Convert components list, e.g.: Network;Sql;WebSockets # Export Qt target lists for individual targets
# into Qt modules: Qt6::Network;Qt6::Sql;Qt6::WebSockets
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# 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) function(_qt_components_to_targets COMPONENTS OUTPUT_VARIABLE)
set(TARGETS) set(TARGETS)
@ -109,10 +113,6 @@ function(_qt_components_to_targets COMPONENTS OUTPUT_VARIABLE)
) )
endfunction() endfunction()
# ---------------------------------------------------------------------------
# Export Qt target lists for the individual targets
# ---------------------------------------------------------------------------
if(WITH_CLIENT) if(WITH_CLIENT)
_qt_components_to_targets("${QT_COMPONENTS_COCKATRICE}" QT_MODULES_COCKATRICE) _qt_components_to_targets("${QT_COMPONENTS_COCKATRICE}" QT_MODULES_COCKATRICE)
endif() endif()
@ -133,7 +133,7 @@ endif()
set(QT_CORE_MODULE "${QT_MAIN_VERSION_STRING}::Core") set(QT_CORE_MODULE "${QT_MAIN_VERSION_STRING}::Core")
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Qt runtime/plugin paths # Qt runtime library & plugin paths
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
if(NOT TARGET "${QT_CORE_MODULE}") if(NOT TARGET "${QT_CORE_MODULE}")
@ -146,7 +146,7 @@ get_filename_component(QT_LIBRARY_DIR "${QT_LIBRARY_DIR}/../../.." ABSOLUTE)
get_filename_component(QT_PLUGINS_DIR "${Qt6Core_DIR}/../../../${QT6_INSTALL_PLUGINS}" ABSOLUTE) get_filename_component(QT_PLUGINS_DIR "${Qt6Core_DIR}/../../../${QT6_INSTALL_PLUGINS}" ABSOLUTE)
if(UNIX AND APPLE) if(UNIX AND APPLE)
# macOS 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") list(APPEND QT_LIBRARY_DIR "/usr/local/lib")
endif() endif()
@ -155,7 +155,7 @@ endif()
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
message(STATUS "Found Qt: ${Qt6_DIR} (found version \"${Qt6_VERSION}\")") message(STATUS "Found Qt: ${Qt6_DIR} (found version \"${Qt6_VERSION}\")")
message(STATUS "REQUIRED_QT_COMPONENTS = ${REQUIRED_QT_COMPONENTS}") message(STATUS "QT_COMPONENTS_REQUIRED = ${QT_COMPONENTS_REQUIRED}")
if(WITH_CLIENT) if(WITH_CLIENT)
message(STATUS "QT_MODULES_COCKATRICE = ${QT_MODULES_COCKATRICE}") message(STATUS "QT_MODULES_COCKATRICE = ${QT_MODULES_COCKATRICE}")
endif() endif()

View file

@ -57,13 +57,21 @@ Page Custom PortableModePageCreate PortableModePageLeave
Function .onInit Function .onInit
${If} ${NSIS_IS_64_BIT} == 1 # NSIS 64bit ${If} ${NSIS_IS_64_BIT} == 1 #NSIS 64bit
${IfNot} ${RunningX64} ${IfNot} ${RunningX64}
MessageBox MB_OK|MB_ICONSTOP "This version of Cockatrice requires a 64-bit Windows system." MessageBox MB_OK|MB_ICONSTOP "This version of Cockatrice requires a 64-bit Windows system."
Abort Abort
${EndIf} ${EndIf}
StrCpy $NormalDestDir "$ProgramFiles64\Cockatrice" StrCpy $NormalDestDir "$ProgramFiles64\Cockatrice"
SetRegView 64 SetRegView 64
${Else} #NSIS 32bit
${If} ${RunningX64}
MessageBox MB_OK|MB_ICONEXCLAMATION \
"You are about to install a 32-bit version of Cockatrice on a 64-bit Windows system.$\n\
We advise you to use the correct 64-bit installer instead to get around potential issues.$\n$\n\
Download from our webpage: https://cockatrice.github.io"
${EndIf}
StrCpy $NormalDestDir "$ProgramFiles\Cockatrice"
${EndIf} ${EndIf}
StrCpy $PortableDestDir "$Desktop\CockatricePortable" StrCpy $PortableDestDir "$Desktop\CockatricePortable"
@ -148,6 +156,7 @@ ${If} $8 != "admin"
${EndIf} ${EndIf}
FunctionEnd FunctionEnd
Function SetModeDestinationFromInstdir Function SetModeDestinationFromInstdir
${If} $PortableMode = 0 ${If} $PortableMode = 0
StrCpy $NormalDestDir $InstDir StrCpy $NormalDestDir $InstDir
@ -166,14 +175,27 @@ Function AutoUninstallIfNeeded
SetShellVarContext all SetShellVarContext all
SetRegView 64 ; --- 32-bit uninstall ---
SetRegView 32
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "QuietUninstallString" ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "QuietUninstallString"
StrCmp $R0 "" done64 StrCmp $R0 "" done32
DetailPrint "Removing previous version..." DetailPrint "Removing previous version (32-bit)..."
ExecWait '$R0' ExecWait '$R0'
done64: done32:
; --- 64-bit uninstall ---
${If} ${RunningX64}
SetRegView 64
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "QuietUninstallString"
StrCmp $R0 "" done64
DetailPrint "Removing previous version (64-bit)..."
ExecWait '$R0'
done64:
${EndIf}
FunctionEnd FunctionEnd
@ -222,23 +244,45 @@ ${EndIf}
${If} $PortableMode = 0 ${If} $PortableMode = 0
SetShellVarContext all SetShellVarContext all
SetRegView 64 # uninstall 32bit version
SetRegView 32
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString" ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString"
StrCmp $R0 "" done64 StrCmp $R0 "" done32
${If} $ReinstallMode = 0 ${If} $ReinstallMode = 0
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst64 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst32
Abort Abort
${Else} ${Else}
Goto uninst64 Goto uninst32
${EndIf} ${EndIf}
uninst64: uninst32:
ClearErrors ClearErrors
ExecWait "$R0" ExecWait "$R0"
done64: done32:
# uninstall 64bit version
${If} ${NSIS_IS_64_BIT} == 1
SetRegView 64
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString"
StrCmp $R0 "" done64
${If} $ReinstallMode = 0
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst64
Abort
${Else}
Goto uninst64
${EndIf}
uninst64:
ClearErrors
ExecWait "$R0"
done64:
${EndIf}
${Else} ${Else}
Abort Abort
@ -252,62 +296,70 @@ SetOutPath "$INSTDIR"
${If} $PortableMode = 1 ${If} $PortableMode = 1
${AndIf} ${FileExists} "$INSTDIR\portable.dat" ${AndIf} ${FileExists} "$INSTDIR\portable.dat"
; upgrade portable mode ; upgrade portable mode
RMDir /r "$INSTDIR\plugins" RMDir /r "$INSTDIR\plugins"
RMDir /r "$INSTDIR\sounds" RMDir /r "$INSTDIR\sounds"
RMDir /r "$INSTDIR\themes" RMDir /r "$INSTDIR\themes"
RMDir /r "$INSTDIR\translations" RMDir /r "$INSTDIR\translations"
Delete "$INSTDIR\uninstall.exe" Delete "$INSTDIR\uninstall.exe"
Delete "$INSTDIR\cockatrice.exe" Delete "$INSTDIR\cockatrice.exe"
Delete "$INSTDIR\oracle.exe" Delete "$INSTDIR\oracle.exe"
Delete "$INSTDIR\servatrice.exe" Delete "$INSTDIR\servatrice.exe"
Delete "$INSTDIR\Qt*.dll" Delete "$INSTDIR\Qt*.dll"
Delete "$INSTDIR\libmysql.dll" Delete "$INSTDIR\libmysql.dll"
Delete "$INSTDIR\icu*.dll" Delete "$INSTDIR\icu*.dll"
Delete "$INSTDIR\libeay32.dll" Delete "$INSTDIR\libeay32.dll"
Delete "$INSTDIR\ssleay32.dll" Delete "$INSTDIR\ssleay32.dll"
Delete "$INSTDIR\qt.conf" Delete "$INSTDIR\qt.conf"
Delete "$INSTDIR\qdebug.txt" Delete "$INSTDIR\qdebug.txt"
Delete "$INSTDIR\servatrice.sql" Delete "$INSTDIR\servatrice.sql"
Delete "$INSTDIR\servatrice.ini.example" Delete "$INSTDIR\servatrice.ini.example"
Delete "$INSTDIR\zlib*.dll" Delete "$INSTDIR\zlib*.dll"
RMDir "$INSTDIR" RMDir "$INSTDIR"
${EndIf} ${EndIf}
@CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@ @CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@
@CPACK_NSIS_FULL_INSTALL@ @CPACK_NSIS_FULL_INSTALL@
${If} $PortableMode = 0 ${If} $PortableMode = 0
WriteUninstaller "$INSTDIR\uninstall.exe" WriteUninstaller "$INSTDIR\uninstall.exe"
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
IntFmt $0 "0x%08X" $0 IntFmt $0 "0x%08X" $0
; Enable Windows User-Mode Dumps ; Enable Windows User-Mode Dumps
; https://learn.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps ; https://learn.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps
WriteRegExpandStr HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" "DumpFolder" "%LOCALAPPDATA%\CrashDumps\Cockatrice" WriteRegExpandStr HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" "DumpFolder" "%LOCALAPPDATA%\CrashDumps\Cockatrice"
WriteRegDWORD HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" "DumpCount" "5" WriteRegDWORD HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" "DumpCount" "5"
WriteRegDWORD HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" "DumpType" "2" WriteRegDWORD HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" "DumpType" "2"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayIcon" "$INSTDIR\cockatrice.exe" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayIcon" "$INSTDIR\cockatrice.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayName" "Cockatrice" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayName" "Cockatrice"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayVersion" "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayVersion" "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "EstimatedSize" "$0" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "EstimatedSize" "$0"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "InstallLocation" "$INSTDIR" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "InstallLocation" "$INSTDIR"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "NoModify" "1" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "NoModify" "1"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "NoRepair" "1" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "NoRepair" "1"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "Publisher" "Cockatrice team" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "Publisher" "Cockatrice team"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "VersionMajor" "@CPACK_PACKAGE_VERSION_MAJOR@" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "VersionMajor" "@CPACK_PACKAGE_VERSION_MAJOR@"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "VersionMinor" "@CPACK_PACKAGE_VERSION_MINOR@" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "VersionMinor" "@CPACK_PACKAGE_VERSION_MINOR@"
IfFileExists "$INSTDIR\vc_redist.x64.exe" VcRedist64Exists PastVcRedist64Check IfFileExists "$INSTDIR\vc_redist.x86.exe" VcRedist86Exists PastVcRedist86Check
VcRedist64Exists: VcRedist86Exists:
ExecWait '"$INSTDIR\vc_redist.x64.exe" /passive /norestart' ExecWait '"$INSTDIR\vc_redist.x86.exe" /passive /norestart'
DetailPrint "Sleep to ensure unlock of vc_redist file after installation..." DetailPrint "Wait to ensure unlock of vc_redist file after installation..."
Sleep 3000 Sleep 3000
Delete "$INSTDIR\vc_redist.x64.exe" Delete "$INSTDIR\vc_redist.x86.exe"
PastVcRedist64Check: PastVcRedist86Check:
IfFileExists "$INSTDIR\vc_redist.x64.exe" VcRedist64Exists PastVcRedist64Check
VcRedist64Exists:
ExecWait '"$INSTDIR\vc_redist.x64.exe" /passive /norestart'
DetailPrint "Sleep to ensure unlock of vc_redist file after installation..."
Sleep 3000
Delete "$INSTDIR\vc_redist.x64.exe"
PastVcRedist64Check:
${Else} ${Else}
; Create the file the application uses to detect portable mode ; Create the file the application uses to detect portable mode
@ -325,51 +377,51 @@ SectionEnd
Section "Start menu item" SecStartMenu Section "Start menu item" SecStartMenu
${If} $PortableMode = 0 ${If} $PortableMode = 0
SetShellVarContext all SetShellVarContext all
createDirectory "$SMPROGRAMS\Cockatrice" createDirectory "$SMPROGRAMS\Cockatrice"
createShortCut "$SMPROGRAMS\Cockatrice\Cockatrice.lnk" "$INSTDIR\cockatrice.exe" createShortCut "$SMPROGRAMS\Cockatrice\Cockatrice.lnk" "$INSTDIR\cockatrice.exe"
createShortCut "$SMPROGRAMS\Cockatrice\Oracle.lnk" "$INSTDIR\oracle.exe" createShortCut "$SMPROGRAMS\Cockatrice\Oracle.lnk" "$INSTDIR\oracle.exe"
createShortCut "$SMPROGRAMS\Cockatrice\Servatrice.lnk" "$INSTDIR\servatrice.exe" createShortCut "$SMPROGRAMS\Cockatrice\Servatrice.lnk" "$INSTDIR\servatrice.exe"
${EndIf} ${EndIf}
SectionEnd SectionEnd
Section "un.Application" UnSecApplication Section "un.Application" UnSecApplication
SetShellVarContext all SetShellVarContext all
RMDir /r "$INSTDIR\plugins" RMDir /r "$INSTDIR\plugins"
RMDir /r "$INSTDIR\sounds" RMDir /r "$INSTDIR\sounds"
RMDir /r "$INSTDIR\themes" RMDir /r "$INSTDIR\themes"
RMDir /r "$INSTDIR\translations" RMDir /r "$INSTDIR\translations"
Delete "$INSTDIR\*.exe" Delete "$INSTDIR\*.exe"
Delete "$INSTDIR\*.dll" Delete "$INSTDIR\*.dll"
Delete "$INSTDIR\qt.conf" Delete "$INSTDIR\qt.conf"
Delete "$INSTDIR\qdebug.txt" Delete "$INSTDIR\qdebug.txt"
Delete "$INSTDIR\servatrice.sql" Delete "$INSTDIR\servatrice.sql"
Delete "$INSTDIR\servatrice.ini.example" Delete "$INSTDIR\servatrice.ini.example"
RMDir "$INSTDIR" RMDir "$INSTDIR"
RMDir "$SMPROGRAMS\Cockatrice" RMDir "$SMPROGRAMS\Cockatrice"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice"
SectionEnd SectionEnd
; unselected because it is /o ; unselected because it is /o
Section /o "un.Configurations, decks, cards, pics" UnSecConfiguration Section /o "un.Configurations, decks, cards, pics" UnSecConfiguration
SetShellVarContext current SetShellVarContext current
DeleteRegKey HKCU "Software\Cockatrice" DeleteRegKey HKCU "Software\Cockatrice"
RMDir /r "$LOCALAPPDATA\Cockatrice" RMDir /r "$LOCALAPPDATA\Cockatrice"
SectionEnd SectionEnd
LangString DESC_SecApplication ${LANG_ENGLISH} "Cockatrice program files" LangString DESC_SecApplication ${LANG_ENGLISH} "Cockatrice program files"
LangString DESC_SecStartMenu ${LANG_ENGLISH} "Create start menu items for Cockatrice and Oracle." LangString DESC_SecStartMenu ${LANG_ENGLISH} "Create start menu items for Cockatrice and Oracle."
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecApplication} $(DESC_SecApplication) !insertmacro MUI_DESCRIPTION_TEXT ${SecApplication} $(DESC_SecApplication)
!insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} $(DESC_SecStartMenu) !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} $(DESC_SecStartMenu)
!insertmacro MUI_FUNCTION_DESCRIPTION_END !insertmacro MUI_FUNCTION_DESCRIPTION_END
LangString DESC_UnSecApplication ${LANG_ENGLISH} "Cockatrice program files and start menu items" LangString DESC_UnSecApplication ${LANG_ENGLISH} "Cockatrice program files and start menu items"
LangString DESC_UnSecConfiguration ${LANG_ENGLISH} "Configurations, decks, card database, pictures" LangString DESC_UnSecConfiguration ${LANG_ENGLISH} "Configurations, decks, card database, pictures"
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${UnSecApplication} $(DESC_UnSecApplication) !insertmacro MUI_DESCRIPTION_TEXT ${UnSecApplication} $(DESC_UnSecApplication)
!insertmacro MUI_DESCRIPTION_TEXT ${UnSecConfiguration} $(DESC_UnSecConfiguration) !insertmacro MUI_DESCRIPTION_TEXT ${UnSecConfiguration} $(DESC_UnSecConfiguration)
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END !insertmacro MUI_UNFUNCTION_DESCRIPTION_END

View file

@ -551,7 +551,7 @@ target_link_libraries(
libcockatrice_models libcockatrice_models
libcockatrice_rng libcockatrice_rng
libcockatrice_settings libcockatrice_settings
${COCKATRICE_QT_MODULES} ${QT_MODULES_COCKATRICE}
) )
if(UNIX) if(UNIX)

View file

@ -10,5 +10,5 @@ add_library(libcockatrice_network INTERFACE)
target_include_directories(libcockatrice_network INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(libcockatrice_network INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries( 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( target_link_libraries(
libcockatrice_network_client 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_abstract libcockatrice_network_client_local
libcockatrice_network_client_remote 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_include_directories(libcockatrice_network_client_abstract PUBLIC .)
target_link_libraries( target_link_libraries(
libcockatrice_network_client_abstract libcockatrice_network_client_abstract PUBLIC ${QT_MAIN_VERSION_STRING}::Network ${QT_MAIN_VERSION_STRING}::WebSockets
PUBLIC ${COCKATRICE_QT_VERSION_NAME}::Network ${COCKATRICE_QT_VERSION_NAME}::WebSockets libcockatrice_protocol libcockatrice_protocol libcockatrice_network_server_remote
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_include_directories(libcockatrice_network_client_local PUBLIC .)
target_link_libraries( target_link_libraries(
libcockatrice_network_client_local libcockatrice_network_client_local PUBLIC ${QT_MAIN_VERSION_STRING}::Network ${QT_MAIN_VERSION_STRING}::WebSockets
PUBLIC ${COCKATRICE_QT_VERSION_NAME}::Network ${COCKATRICE_QT_VERSION_NAME}::WebSockets libcockatrice_network_client_abstract
libcockatrice_network_client_abstract
) )

View file

@ -16,6 +16,6 @@ target_include_directories(libcockatrice_network_client_remote PUBLIC .)
target_link_libraries( target_link_libraries(
libcockatrice_network_client_remote libcockatrice_network_client_remote
PUBLIC ${COCKATRICE_QT_VERSION_NAME}::Network ${COCKATRICE_QT_VERSION_NAME}::WebSockets PUBLIC ${QT_MAIN_VERSION_STRING}::Network ${QT_MAIN_VERSION_STRING}::WebSockets libcockatrice_network_client_abstract
libcockatrice_network_client_abstract libcockatrice_interfaces libcockatrice_utility libcockatrice_protocol 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_include_directories(libcockatrice_network_server INTERFACE .)
target_link_libraries( 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 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_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 # Make cockatrice_server depend on cockatrice_protocol
target_link_libraries( target_link_libraries(
libcockatrice_network_server_remote PUBLIC libcockatrice_protocol libcockatrice_utility libcockatrice_rng 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}) target_link_libraries(libcockatrice_utility PUBLIC libcockatrice_rng OpenSSL::Crypto ${QT_CORE_MODULE})
set(ORACLE_LIBS) set(ORACLE_LIBS)
include_directories(${${COCKATRICE_QT_VERSION_NAME}Core_INCLUDE_DIRS})

View file

@ -122,7 +122,7 @@ target_link_libraries(
PUBLIC libcockatrice_card PUBLIC libcockatrice_card
PUBLIC libcockatrice_settings PUBLIC libcockatrice_settings
PUBLIC libcockatrice_network PUBLIC libcockatrice_network
PUBLIC ${ORACLE_QT_MODULES} PUBLIC ${QT_MODULES_ORACLE}
) )
if(ZLIB_FOUND) if(ZLIB_FOUND)

View file

@ -99,12 +99,12 @@ target_precompile_headers(servatrice PRIVATE "${CMAKE_SOURCE_DIR}/cmake/pch/qtco
if(CMAKE_HOST_SYSTEM MATCHES "FreeBSD") if(CMAKE_HOST_SYSTEM MATCHES "FreeBSD")
target_link_libraries( 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} ${LIBEXECINFO_LIBRARY}
) )
else() else()
target_link_libraries( 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() endif()

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 (the QT_COMPONENTS_TEST variable).
# If a new test needs additional Qt modules, add them there — not in individual test CMakeLists.txt files. # If a new test needs additional Qt modules, add them there — not in individual test CMakeLists.txt files.
enable_testing() enable_testing()
@ -18,8 +18,6 @@ add_test(NAME latency_tracker_test COMMAND latency_tracker_test)
add_test(NAME deck_hash_performance_test COMMAND deck_hash_performance_test) add_test(NAME deck_hash_performance_test COMMAND deck_hash_performance_test)
set_tests_properties(deck_hash_performance_test PROPERTIES TIMEOUT 15) set_tests_properties(deck_hash_performance_test PROPERTIES TIMEOUT 15)
# Find GTest
add_executable(dummy_test dummy_test.cpp) add_executable(dummy_test dummy_test.cpp)
add_executable(expression_test expression_test.cpp) add_executable(expression_test expression_test.cpp)
add_executable(clamped_arithmetic_test clamped_arithmetic_test.cpp) add_executable(clamped_arithmetic_test clamped_arithmetic_test.cpp)
@ -35,6 +33,7 @@ add_executable(lag_monitor_test ${CMAKE_SOURCE_DIR}/cockatrice/src/client/lag_mo
target_include_directories(lag_monitor_test PRIVATE ${CMAKE_SOURCE_DIR}/cockatrice/src) target_include_directories(lag_monitor_test PRIVATE ${CMAKE_SOURCE_DIR}/cockatrice/src)
add_executable(latency_tracker_test latency_tracker_test.cpp) add_executable(latency_tracker_test latency_tracker_test.cpp)
# Find GTest
find_package(GTest) find_package(GTest)
if(NOT GTEST_FOUND) if(NOT GTEST_FOUND)
@ -77,39 +76,39 @@ endif()
include_directories(${GTEST_INCLUDE_DIRS}) include_directories(${GTEST_INCLUDE_DIRS})
target_link_libraries(dummy_test Threads::Threads ${GTEST_BOTH_LIBRARIES}) 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( 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( 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( 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( target_link_libraries(
playmat_resolver_test libcockatrice_deck_list libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} playmat_resolver_test libcockatrice_deck_list libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES}
${TEST_QT_MODULES} ${QT_MODULES_TEST}
) )
target_link_libraries( target_link_libraries(
deck_hash_performance_test libcockatrice_deck_list libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} deck_hash_performance_test libcockatrice_deck_list libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES}
${TEST_QT_MODULES} ${QT_MODULES_TEST}
) )
target_link_libraries( 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( target_link_libraries(
server_counter_test libcockatrice_network Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES} server_counter_test libcockatrice_network Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
) )
target_link_libraries( target_link_libraries(
server_rate_limiter_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${TEST_QT_MODULES} server_rate_limiter_test libcockatrice_utility Threads::Threads ${GTEST_BOTH_LIBRARIES} ${QT_MODULES_TEST}
) )
target_link_libraries( 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( 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}
) )
add_subdirectory(card_zone_algorithms) add_subdirectory(card_zone_algorithms)

View file

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

View file

@ -11,7 +11,7 @@ target_link_libraries(
libcockatrice_deck_list libcockatrice_deck_list
Threads::Threads Threads::Threads
${GTEST_BOTH_LIBRARIES} ${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) 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 libcockatrice_deck_list
Threads::Threads Threads::Threads
${GTEST_BOTH_LIBRARIES} ${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) 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() endif()
target_link_libraries( 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) add_test(NAME deck_list_zones_test COMMAND deck_list_zones_test)

View file

@ -7,6 +7,6 @@ endif()
target_link_libraries( target_link_libraries(
loading_from_clipboard_test libcockatrice_deck_list libcockatrice_card Threads::Threads ${GTEST_BOTH_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) 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 libcockatrice_rng
PRIVATE Threads::Threads PRIVATE Threads::Threads
PRIVATE ${GTEST_BOTH_LIBRARIES} PRIVATE ${GTEST_BOTH_LIBRARIES}
PRIVATE ${TEST_QT_MODULES} PRIVATE ${QT_MODULES_TEST}
) )
add_test(NAME reverse_card_move_test COMMAND reverse_card_move_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) add_dependencies(parse_cipt_test gtest)
endif() 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) add_test(NAME parse_cipt_test COMMAND parse_cipt_test)
@ -20,7 +20,7 @@ endif()
target_link_libraries( target_link_libraries(
oracle_importer_test libcockatrice_card libcockatrice_interfaces Threads::Threads ${GTEST_BOTH_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) add_test(NAME oracle_importer_test COMMAND oracle_importer_test)
@ -64,6 +64,6 @@ target_link_libraries(
libcockatrice_interfaces libcockatrice_interfaces
Threads::Threads Threads::Threads
${GTEST_BOTH_LIBRARIES} ${GTEST_BOTH_LIBRARIES}
${TEST_QT_MODULES} ${QT_MODULES_TEST}
${_ORACLE_BENCH_EXTRA_LIBRARIES} ${_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) add_executable(settings_migration_test settings_migration_test.cpp)
target_link_libraries( 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( 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_compile_definitions(settings_defaults_test PRIVATE SETTINGS_UNIT_TEST)
target_link_libraries( 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) add_test(NAME settings_manager_test COMMAND settings_manager_test)