From 9190c2b31defaccfb40e43aa7c4f022225fb36ff Mon Sep 17 00:00:00 2001 From: tooomm Date: Tue, 27 May 2025 21:49:24 +0200 Subject: [PATCH 01/18] use ninja on windows --- .ci/compile.sh | 8 +------- .github/workflows/desktop-build.yml | 12 ++++-------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.ci/compile.sh b/.ci/compile.sh index 6f51bc476..70e177b55 100755 --- a/.ci/compile.sh +++ b/.ci/compile.sh @@ -140,13 +140,7 @@ cmake .. "${flags[@]}" echo "::endgroup::" echo "::group::Build project" -if [[ $RUNNER_OS == Windows ]]; then - # Enable MTT, see https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/ - # and https://devblogs.microsoft.com/cppblog/cpp-build-throughput-investigation-and-tune-up/#multitooltask-mtt - cmake --build . "${buildflags[@]}" -- -p:UseMultiToolTask=true -p:EnableClServerMode=true -else - cmake --build . "${buildflags[@]}" -fi +cmake --build . "${buildflags[@]}" echo "::endgroup::" if [[ $USE_CCACHE ]]; then diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 1a9f18661..db0b71f02 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -377,20 +377,17 @@ jobs: needs: configure runs-on: windows-2022 env: - CMAKE_GENERATOR: 'Visual Studio 17 2022' + CMAKE_GENERATOR: 'Ninja' steps: - - name: Add msbuild to PATH - id: add-msbuild - uses: microsoft/setup-msbuild@v2 - with: - msbuild-architecture: x64 - - name: Checkout uses: actions/checkout@v4 with: submodules: recursive + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Install Qt ${{matrix.qt_version}} uses: jurplel/install-qt-action@v4 with: @@ -413,7 +410,6 @@ jobs: env: PACKAGE_SUFFIX: '-Win${{matrix.target}}' CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}' - CMAKE_GENERATOR_PLATFORM: 'x64' QTDIR: '${{github.workspace}}\Qt\${{matrix.qt_version}}\win64_${{matrix.qt_arch}}' VCPKG_DISABLE_METRICS: 1 VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite' From 4fdaaa2c73235c3a8d8e8d1d59928d2f6406c4ae Mon Sep 17 00:00:00 2001 From: tooomm Date: Wed, 28 May 2025 22:00:51 +0200 Subject: [PATCH 02/18] list liblzma.dll on win --- .ci/compile.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.ci/compile.sh b/.ci/compile.sh index 70e177b55..6bd37c4b9 100755 --- a/.ci/compile.sh +++ b/.ci/compile.sh @@ -161,6 +161,19 @@ if [[ $MAKE_INSTALL ]]; then echo "::endgroup::" fi +if [[ $RUNNER_OS == Windows ]]; then + echo "Searching for liblzma.dll after build..." + FOUND_DLL=$(find . -name "liblzma.dll" 2>/dev/null) + + if [ -n "$FOUND_DLL" ]; then + echo "liblzma.dll found at:" + echo "$FOUND_DLL" + else + echo "ERROR: liblzma.dll not found after build!" + exit 1 + fi +fi + if [[ $MAKE_PACKAGE ]]; then echo "::group::Create package" From 538699f28a56a1c73faa1284791cd3380b79b7a3 Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 17:22:40 +0200 Subject: [PATCH 03/18] copy/link dll --- CMakeLists.txt | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29ee84798..4725e8f17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ # This file sets all the variables shared between the projects # like the installation path, compilation flags etc.. -# cmake 3.16 is required if using qt6 +# CMake 3.16 is required if using Qt6 cmake_minimum_required(VERSION 3.10) # Early detect ccache @@ -81,7 +81,7 @@ if(NOT DEFINED GIT_TAG_RELEASENAME) set(GIT_TAG_RELEASENAME "Omenpath") endif() -# Use c++20 for all targets +# Use C++20 for all targets set(CMAKE_CXX_STANDARD 20 CACHE STRING "C++ ISO Standard" @@ -183,7 +183,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX) endif() endforeach() else() - # other: osx/llvm, bsd/llvm + # Other: osx/llvm, bsd/llvm set(CMAKE_CXX_FLAGS_RELEASE "-O2") if(WARNING_AS_ERROR) set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra -Werror -Wno-unused-parameter") @@ -232,7 +232,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) @@ -245,7 +245,7 @@ if(WIN32) endif() endif() -#Find VCredist +# Find VCredist if(MSVC) find_package(VCredistRuntime) endif() @@ -273,7 +273,7 @@ if(UNIX) 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 + # Linux if(CPACK_GENERATOR STREQUAL "RPM") set(CPACK_RPM_PACKAGE_LICENSE "GPLv2") set(CPACK_RPM_MAIN_COMPONENT "cockatrice") @@ -284,7 +284,7 @@ if(UNIX) endif() set(CPACK_RPM_PACKAGE_GROUP "Amusements/Games") set(CPACK_RPM_PACKAGE_URL "http://github.com/Cockatrice/Cockatrice") - # stop directories from making package conflicts + # Stop directories from making package conflicts set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/share/applications /usr/share/icons @@ -314,10 +314,22 @@ elseif(WIN32) set(TRICE_IS_64_BIT 0) endif() - # Configure file with custom definitions for NSIS. + # Configure file with custom definitions for NSIS configure_file("${COCKATRICE_CMAKE_PATH}/NSIS.definitions.nsh.in" "${PROJECT_BINARY_DIR}/NSIS.definitions.nsh") - # include vcredist into the package; NSIS will take care of running it + # Include liblzma.dll into the package + # install(FILES "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll" DESTINATION ./) + + # Make sure vcpkg's toolchain is in use and lzma is available as a target + # find_package(lzma CONFIG REQUIRED) + # This will install the DLL if present (vcpkg target will point to the correct location) + # install(TARGETS lzma + # RUNTIME DESTINATION . + # LIBRARY DESTINATION lib + # ARCHIVE DESTINATION lib + # ) + + # Include vcredist into the package; NSIS will take care of running it if(VCREDISTRUNTIME_FOUND) install(FILES "${VCREDISTRUNTIME_FILE}" DESTINATION ./) endif() @@ -352,6 +364,6 @@ if(TEST) endif() if(Qt6_FOUND AND Qt6_VERSION_MINOR GREATER_EQUAL 3) - # Qt6.3+ requires project finalization to support translations + # Qt 6.3+ requires project finalization to support translations qt6_finalize_project() endif() From 1801472475860ee359bdf287e9c3286fdadacb33 Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 14:22:58 +0200 Subject: [PATCH 04/18] vcpkg.cmake toolchain --- .ci/compile.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.ci/compile.sh b/.ci/compile.sh index 6bd37c4b9..5ea2a395f 100755 --- a/.ci/compile.sh +++ b/.ci/compile.sh @@ -114,6 +114,11 @@ if [[ $PACKAGE_TYPE ]]; then flags+=("-DCPACK_GENERATOR=$PACKAGE_TYPE") fi +#if [[ $RUNNER_OS == Windows ]]; then +# VCPKG_TOOLCHAIN_FILE="D:/a/Cockatrice/vcpkg/scripts/buildsystems/vcpkg.cmake" +# flags+=("-DCMAKE_TOOLCHAIN_FILE=$VCPKG_TOOLCHAIN_FILE" "-DVCPKG_TARGET_TRIPLET=x64-windows") +#fi + # Add cmake --build flags buildflags=(--config "$BUILDTYPE") From 785d84d303a0f159659fff1f8b4975c5c65fdc71 Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 17:24:28 +0200 Subject: [PATCH 05/18] cleanup --- .ci/compile.sh | 2 +- oracle/CMakeLists.txt | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.ci/compile.sh b/.ci/compile.sh index 5ea2a395f..0796d0b2f 100755 --- a/.ci/compile.sh +++ b/.ci/compile.sh @@ -139,7 +139,7 @@ if [[ $USE_CCACHE ]]; then echo "::endgroup::" fi -echo "::group::Configure cmake" +echo "::group::Configure CMake" cmake --version cmake .. "${flags[@]}" echo "::endgroup::" diff --git a/oracle/CMakeLists.txt b/oracle/CMakeLists.txt index 130dfdaab..c6ec2d5f6 100644 --- a/oracle/CMakeLists.txt +++ b/oracle/CMakeLists.txt @@ -51,11 +51,11 @@ if(UPDATE_TRANSLATIONS) set(oracle_TS "${CMAKE_CURRENT_SOURCE_DIR}/oracle_en@source.ts") else() file(GLOB oracle_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts") -endif(UPDATE_TRANSLATIONS) +endif() if(WIN32) set(oracle_SOURCES ${oracle_SOURCES} oracle.rc) -endif(WIN32) +endif() if(APPLE) set(MACOSX_BUNDLE_ICON_FILE appicon.icns) @@ -63,7 +63,7 @@ if(APPLE) ${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) set(oracle_SOURCES ${oracle_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns) -endif(APPLE) +endif() if(Qt6_FOUND) qt6_add_resources(oracle_RESOURCES_RCC ${oracle_RESOURCES}) @@ -73,12 +73,11 @@ endif() include_directories(../cockatrice/src) -# Libz is required to support zipped files +# Libz is required to support zip files find_package(ZLIB) if(ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIRS}) add_definitions("-DHAS_ZLIB") - set(oracle_SOURCES ${oracle_SOURCES} src/zip/unzip.cpp src/zip/zipglobal.cpp) else() message(STATUS "Oracle: zlib not found; ZIP support disabled") @@ -89,7 +88,6 @@ find_package(LibLZMA) if(LIBLZMA_FOUND) include_directories(${LIBLZMA_INCLUDE_DIRS}) add_definitions("-DHAS_LZMA") - set(oracle_SOURCES ${oracle_SOURCES} src/lzma/decompress.cpp) else() message(STATUS "Oracle: LibLZMA not found; xz support disabled") @@ -164,7 +162,7 @@ endif() if(NOT WIN32 AND NOT APPLE) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/oracle.desktop DESTINATION ${DESKTOPDIR}) -endif(NOT WIN32 AND NOT APPLE) +endif() if(APPLE) # these needs to be relative to CMAKE_INSTALL_PREFIX From 0d1fe1231de14142e7b8dadc3141bd647131009f Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 19:13:10 +0200 Subject: [PATCH 06/18] try ignore other path of liblzma.dll --- oracle/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/oracle/CMakeLists.txt b/oracle/CMakeLists.txt index c6ec2d5f6..e73bce0fb 100644 --- a/oracle/CMakeLists.txt +++ b/oracle/CMakeLists.txt @@ -251,6 +251,12 @@ Translations = Resources/translations\") file(GLOB_RECURSE QTPLUGINS \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\") set(BU_CHMOD_BUNDLE_ITEMS ON) + + # Ignore directories that contain unwanted DLLs (liblzma.dll) + set(FIXUP_BUNDLE_IGNORE_PATHS + \"${CMAKE_SOURCE_DIR}/oracle\" + \"${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/debug/bin\") + include(BundleUtilities) fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/Oracle.exe\" \"\${QTPLUGINS}\" \"${libSearchDirs}\") " From 5d77f58596ab2049995aff1756e714a854cbef80 Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 19:40:15 +0200 Subject: [PATCH 07/18] Update CMakeLists.txt --- oracle/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oracle/CMakeLists.txt b/oracle/CMakeLists.txt index e73bce0fb..e1e135ea8 100644 --- a/oracle/CMakeLists.txt +++ b/oracle/CMakeLists.txt @@ -254,8 +254,8 @@ Translations = Resources/translations\") # Ignore directories that contain unwanted DLLs (liblzma.dll) set(FIXUP_BUNDLE_IGNORE_PATHS - \"${CMAKE_SOURCE_DIR}/oracle\" - \"${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/debug/bin\") + \"\${CMAKE_INSTALL_PREFIX}/oracle\" + \"\${CMAKE_INSTALL_PREFIX}/vcpkg_installed/x64-windows/debug/bin\") include(BundleUtilities) fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/Oracle.exe\" \"\${QTPLUGINS}\" \"${libSearchDirs}\") From e6ee47f5b8579553d63bd7b14eb8801cc3c1a9e4 Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 20:10:05 +0200 Subject: [PATCH 08/18] Update CMakeLists.txt --- oracle/CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/oracle/CMakeLists.txt b/oracle/CMakeLists.txt index e1e135ea8..c6ec2d5f6 100644 --- a/oracle/CMakeLists.txt +++ b/oracle/CMakeLists.txt @@ -251,12 +251,6 @@ Translations = Resources/translations\") file(GLOB_RECURSE QTPLUGINS \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\") set(BU_CHMOD_BUNDLE_ITEMS ON) - - # Ignore directories that contain unwanted DLLs (liblzma.dll) - set(FIXUP_BUNDLE_IGNORE_PATHS - \"\${CMAKE_INSTALL_PREFIX}/oracle\" - \"\${CMAKE_INSTALL_PREFIX}/vcpkg_installed/x64-windows/debug/bin\") - include(BundleUtilities) fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/Oracle.exe\" \"\${QTPLUGINS}\" \"${libSearchDirs}\") " From 32965dddae32c7e043895695ee3f91666230ad99 Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 20:10:18 +0200 Subject: [PATCH 09/18] Update compile.sh --- .ci/compile.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.ci/compile.sh b/.ci/compile.sh index 0796d0b2f..4c19ecea9 100755 --- a/.ci/compile.sh +++ b/.ci/compile.sh @@ -173,10 +173,18 @@ if [[ $RUNNER_OS == Windows ]]; then if [ -n "$FOUND_DLL" ]; then echo "liblzma.dll found at:" echo "$FOUND_DLL" + + echo "Cleaning up duplicate debug DLLs" + rm -f ./oracle/liblzma.dll + rm -f ./vcpkg_installed/x64-windows/debug/bin/liblzma.dll + + echo "$FOUND_DLL" + else echo "ERROR: liblzma.dll not found after build!" exit 1 fi + fi if [[ $MAKE_PACKAGE ]]; then From 63d2bcc6225f7a71faa8535513ffe314c673ce50 Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 20:29:50 +0200 Subject: [PATCH 10/18] Update compile.sh --- .ci/compile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/compile.sh b/.ci/compile.sh index 4c19ecea9..ac32a43a4 100755 --- a/.ci/compile.sh +++ b/.ci/compile.sh @@ -178,7 +178,7 @@ if [[ $RUNNER_OS == Windows ]]; then rm -f ./oracle/liblzma.dll rm -f ./vcpkg_installed/x64-windows/debug/bin/liblzma.dll - echo "$FOUND_DLL" + find . -iname "liblzma.dll" else echo "ERROR: liblzma.dll not found after build!" From 181989ff799e9af9f75008e6049fbf3d69ba0f3e Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 21:02:17 +0200 Subject: [PATCH 11/18] Update CMakeLists.txt --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4725e8f17..5f9edb0b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,6 +319,8 @@ elseif(WIN32) # Include liblzma.dll into the package # install(FILES "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll" DESTINATION ./) + install(FILES "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll" + DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") # Make sure vcpkg's toolchain is in use and lzma is available as a target # find_package(lzma CONFIG REQUIRED) From 70afcd2ffdd893e3aedc12991e0d1e4465f39bc0 Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 21:37:37 +0200 Subject: [PATCH 12/18] Update CMakeLists.txt --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f9edb0b0..0282f2d57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,8 +319,7 @@ elseif(WIN32) # Include liblzma.dll into the package # install(FILES "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll" DESTINATION ./) - install(FILES "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll" - DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") + install(FILES "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll" DESTINATION "bin") # Make sure vcpkg's toolchain is in use and lzma is available as a target # find_package(lzma CONFIG REQUIRED) From 81a53401e1d6d19b6856ae14080d9b71e8500a82 Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 22:15:55 +0200 Subject: [PATCH 13/18] Update CMakeLists.txt --- oracle/CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/oracle/CMakeLists.txt b/oracle/CMakeLists.txt index c6ec2d5f6..35252d90f 100644 --- a/oracle/CMakeLists.txt +++ b/oracle/CMakeLists.txt @@ -246,16 +246,16 @@ Translations = Resources/translations\") COMPONENT Runtime ) - install( - CODE " - file(GLOB_RECURSE QTPLUGINS - \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\") - set(BU_CHMOD_BUNDLE_ITEMS ON) - include(BundleUtilities) - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/Oracle.exe\" \"\${QTPLUGINS}\" \"${libSearchDirs}\") - " - COMPONENT Runtime - ) + # install( + # CODE " + # file(GLOB_RECURSE QTPLUGINS + # \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\") + # set(BU_CHMOD_BUNDLE_ITEMS ON) + # include(BundleUtilities) + # fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/Oracle.exe\" \"\${QTPLUGINS}\" \"${libSearchDirs}\") + # " + # COMPONENT Runtime + # ) endif() if(Qt6_FOUND AND Qt6LinguistTools_FOUND) From 219778c5a1016328fbc1e9ceaf6c364702064c7c Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 22:36:26 +0200 Subject: [PATCH 14/18] Update CMakeLists.txt --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0282f2d57..9c4dd83f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,7 +319,15 @@ elseif(WIN32) # Include liblzma.dll into the package # install(FILES "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll" DESTINATION ./) - install(FILES "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll" DESTINATION "bin") + # install(FILES "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll" DESTINATION "bin") + + set(LIBLZMA_DLL "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll") + + if(EXISTS "${LIBLZMA_DLL}") + install(FILES "${LIBLZMA_DLL}" DESTINATION ./) + else() + message(WARNING "liblzma.dll not found at ${LIBLZMA_DLL}, skipping DLL install.") + endif() # Make sure vcpkg's toolchain is in use and lzma is available as a target # find_package(lzma CONFIG REQUIRED) From c40abb39182f61a822df9db8f233e90b23e2af91 Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 22:58:28 +0200 Subject: [PATCH 15/18] Update CMakeLists.txt --- oracle/CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/oracle/CMakeLists.txt b/oracle/CMakeLists.txt index 35252d90f..056fc27b5 100644 --- a/oracle/CMakeLists.txt +++ b/oracle/CMakeLists.txt @@ -246,16 +246,16 @@ Translations = Resources/translations\") COMPONENT Runtime ) - # install( - # CODE " - # file(GLOB_RECURSE QTPLUGINS - # \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\") - # set(BU_CHMOD_BUNDLE_ITEMS ON) - # include(BundleUtilities) - # fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/Oracle.exe\" \"\${QTPLUGINS}\" \"${libSearchDirs}\") - # " - # COMPONENT Runtime - # ) + # install( + # CODE " + # file(GLOB_RECURSE QTPLUGINS + # \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\") + # set(BU_CHMOD_BUNDLE_ITEMS ON) + # include(BundleUtilities) + # fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/Oracle.exe\" \"\${QTPLUGINS}\" \"${libSearchDirs}\") + # " + # COMPONENT Runtime + # ) endif() if(Qt6_FOUND AND Qt6LinguistTools_FOUND) From b64ef36e43b6e15417d92ad2ede8fc22ae114ede Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 23:33:53 +0200 Subject: [PATCH 16/18] Update CMakeLists.txt --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c4dd83f0..e3f0518a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -321,13 +321,13 @@ elseif(WIN32) # install(FILES "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll" DESTINATION ./) # install(FILES "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll" DESTINATION "bin") - set(LIBLZMA_DLL "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll") - - if(EXISTS "${LIBLZMA_DLL}") - install(FILES "${LIBLZMA_DLL}" DESTINATION ./) - else() - message(WARNING "liblzma.dll not found at ${LIBLZMA_DLL}, skipping DLL install.") - endif() + # set(LIBLZMA_DLL "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/bin/liblzma.dll") + # + # if(EXISTS "${LIBLZMA_DLL}") + # install(FILES "${LIBLZMA_DLL}" DESTINATION ./) + # else() + # message(WARNING "liblzma.dll not found at ${LIBLZMA_DLL}, skipping DLL install.") + # endif() # Make sure vcpkg's toolchain is in use and lzma is available as a target # find_package(lzma CONFIG REQUIRED) From f3f92bca9c78e034fc54a4b7e3c8ad377e013551 Mon Sep 17 00:00:00 2001 From: tooomm Date: Thu, 29 May 2025 23:45:02 +0200 Subject: [PATCH 17/18] Update CMakeLists.txt --- oracle/CMakeLists.txt | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/oracle/CMakeLists.txt b/oracle/CMakeLists.txt index 056fc27b5..9b81f2874 100644 --- a/oracle/CMakeLists.txt +++ b/oracle/CMakeLists.txt @@ -151,7 +151,7 @@ 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) @@ -205,17 +205,17 @@ Translations = Resources/translations\") endif() if(WIN32) - # these needs to be relative to CMAKE_INSTALL_PREFIX + # These needs to be relative to CMAKE_INSTALL_PREFIX set(plugin_dest_dir Plugins) set(qtconf_dest_dir .) list(APPEND libSearchDirs ${QT_LIBRARY_DIR}) - install( - DIRECTORY "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${CMAKE_BUILD_TYPE}/" - DESTINATION ./ - FILES_MATCHING - PATTERN "*.dll" - ) + # install( + # DIRECTORY "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${CMAKE_BUILD_TYPE}/" + # DESTINATION ./ + # FILES_MATCHING + # PATTERN "*.dll" + # ) # Qt plugins: iconengines, platforms, styles, tls (Qt6) install( @@ -288,3 +288,15 @@ endif() if(Qt6_FOUND) qt6_finalize_target(oracle) endif() + +if(WIN32) + install(CODE " + include(BundleUtilities) + set(BU_CHMOD_BUNDLE_ITEMS ON) + fixup_bundle( + \"\${CMAKE_INSTALL_PREFIX}/Oracle.exe\" + \"\" + \"\${CMAKE_INSTALL_PREFIX}\" + ) + ") +endif() From 6e7f35b0d5f53e69f75002539a54582cdb04cc4b Mon Sep 17 00:00:00 2001 From: tooomm Date: Fri, 30 May 2025 00:25:45 +0200 Subject: [PATCH 18/18] Update CMakeLists.txt --- cockatrice/CMakeLists.txt | 143 ++++++++++++-------------------------- 1 file changed, 46 insertions(+), 97 deletions(-) diff --git a/cockatrice/CMakeLists.txt b/cockatrice/CMakeLists.txt index c25b319db..bb002f976 100644 --- a/cockatrice/CMakeLists.txt +++ b/cockatrice/CMakeLists.txt @@ -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/game_logic/abstract_client.cpp src/client/game_logic/key_signals.cpp src/client/get_text_with_max.cpp @@ -266,11 +266,11 @@ if(UPDATE_TRANSLATIONS) set(cockatrice_TS "${CMAKE_CURRENT_SOURCE_DIR}/cockatrice_en@source.ts") else() file(GLOB cockatrice_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts") -endif(UPDATE_TRANSLATIONS) +endif() if(WIN32) set(cockatrice_SOURCES ${cockatrice_SOURCES} cockatrice.rc) -endif(WIN32) +endif() if(APPLE) set(MACOSX_BUNDLE_ICON_FILE appicon.icns) @@ -278,7 +278,7 @@ if(APPLE) ${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) set(cockatrice_SOURCES ${cockatrice_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns) -endif(APPLE) +endif() if(Qt6_FOUND) qt6_add_resources(cockatrice_RESOURCES_RCC ${cockatrice_RESOURCES}) @@ -317,7 +317,7 @@ if(Qt6_FOUND) MANUAL_FINALIZATION ) elseif(Qt5_FOUND) - # Qt5 Translations need to be linked at executable creation time + # Qt5 translations need to be linked at executable creation time if(Qt5LinguistTools_FOUND) if(UPDATE_TRANSLATIONS) qt5_create_translation(cockatrice_QM ${translate_SRCS} ${cockatrice_TS}) @@ -359,7 +359,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) @@ -369,27 +369,17 @@ elseif(WIN32) install(TARGETS cockatrice RUNTIME DESTINATION ./) endif() +include(BundleUtilities) + 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 (Qt5), iconengines, imageformats, multimedia (Qt6), platforms, printsupport (Qt5), styles, tls (Qt6) - install( - DIRECTORY "${QT_PLUGINS_DIR}/" - DESTINATION ${plugin_dest_dir} + install(DIRECTORY "${QT_PLUGINS_DIR}/" + DESTINATION cockatrice.app/Contents/Plugins COMPONENT Runtime - 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" + FILES_MATCHING PATTERN "*.dylib" ) install( @@ -399,94 +389,53 @@ if(APPLE) PATTERN "*.ini" ) - install( - CODE " - file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"[Paths] -Plugins = Plugins -Translations = Resources/translations -Data = Resources\") - " - COMPONENT Runtime - ) + # Copy qt.conf with correct paths + install(CODE " + file(WRITE \"\${CMAKE_INSTALL_PREFIX}/cockatrice.app/Contents/Resources/qt.conf\" \"[Paths] + Plugins = Plugins + Translations = Resources/translations + Data = Resources\") + ") - install( - CODE " - file(GLOB_RECURSE QTPLUGINS - \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dylib\") - set(BU_CHMOD_BUNDLE_ITEMS ON) - include(BundleUtilities) - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/cockatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") - " - COMPONENT Runtime - ) + install(CODE " + set(BU_CHMOD_BUNDLE_ITEMS ON) + file(GLOB_RECURSE QTPLUGINS + \"\${CMAKE_INSTALL_PREFIX}/cockatrice.app/Contents/Plugins/*.dylib\") + fixup_bundle( + \"\${CMAKE_INSTALL_PREFIX}/cockatrice.app\" + \"\${QTPLUGINS}\" + \"${QT_LIBRARY_DIR}\" + ) + ") endif() if(WIN32) - # these needs to be relative to CMAKE_INSTALL_PREFIX + # These needs to be relative to CMAKE_INSTALL_PREFIX set(plugin_dest_dir Plugins) set(qtconf_dest_dir .) - install( - DIRECTORY "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${CMAKE_BUILD_TYPE}/" - DESTINATION ./ - FILES_MATCHING - PATTERN "*.dll" + install(DIRECTORY "${QT_PLUGINS_DIR}/" + DESTINATION Plugins + COMPONENT Runtime + FILES_MATCHING PATTERN "*.dll" ) install( DIRECTORY "${CMAKE_BINARY_DIR}/cockatrice/" DESTINATION ./ - FILES_MATCHING - PATTERN "*.ini" + FILES_MATCHING PATTERN "*.ini" ) - # Qt plugins: audio (Qt5), iconengines, imageformats, multimedia (Qt6) platforms, printsupport (Qt5), styles, tls (Qt6) - 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" - PATTERN "mediaservice/wmfengine.dll" - PATTERN "multimedia/*.dll" - PATTERN "platforms/qdirect2d.dll" - 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" - PATTERN "styles/qwindowsvistastyle.dll" - PATTERN "tls/qcertonlybackend.dll" - PATTERN "tls/qopensslbackend.dll" - PATTERN "tls/qschannelbackend.dll" - ) - - install( - CODE " - file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"[Paths] -Plugins = Plugins -Translations = Resources/translations -Data = Resources\") - " - COMPONENT Runtime - ) - - install( - CODE " - file(GLOB_RECURSE QTPLUGINS - \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\") - set(BU_CHMOD_BUNDLE_ITEMS ON) - include(BundleUtilities) - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/Cockatrice.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") - " - COMPONENT Runtime - ) + install(CODE " + set(BU_CHMOD_BUNDLE_ITEMS ON) + file(GLOB_RECURSE QTPLUGINS + \"\${CMAKE_INSTALL_PREFIX}/Plugins/*.dll\") + fixup_bundle( + \"\${CMAKE_INSTALL_PREFIX}/Cockatrice.exe\" + \"\${QTPLUGINS}\" + \"${QT_LIBRARY_DIR}\" + ) + ") if(OPENSSL_FOUND) install(FILES ${OPENSSL_INCLUDE_DIRS} DESTINATION ./)