From 3613b6c696262737c0d575f14b62daa5566d4d01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Thu, 20 Nov 2025 14:47:36 +0100 Subject: [PATCH] Update CMakeLists.txt for zip and lzma support. Took 9 minutes --- cockatrice/CMakeLists.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/cockatrice/CMakeLists.txt b/cockatrice/CMakeLists.txt index d1b2deef9..b7a68ac4d 100644 --- a/cockatrice/CMakeLists.txt +++ b/cockatrice/CMakeLists.txt @@ -306,6 +306,30 @@ if(APPLE) set(cockatrice_SOURCES ${cockatrice_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns) endif(APPLE) +# Libz is required to support zipped files +find_package(ZLIB) +if(ZLIB_FOUND) + include_directories(${ZLIB_INCLUDE_DIRS}) + add_definitions("-DHAS_ZLIB") + + set(cockatrice_SOURCES ${cockatrice_SOURCES} src/utility/external/zip/unzip.cpp + src/utility/external/zip/zipglobal.cpp + ) +else() + message(STATUS "Cockatrice: zlib not found; ZIP support disabled") +endif() + +# LibLZMA is required to support xz files +find_package(LibLZMA) +if(LIBLZMA_FOUND) + include_directories(${LIBLZMA_INCLUDE_DIRS}) + add_definitions("-DHAS_LZMA") + + set(cockatrice_SOURCES ${cockatrice_SOURCES} src/utility/external/lzma/decompress.cpp) +else() + message(STATUS "Cockatrice: LibLZMA not found; xz support disabled") +endif() + if(Qt6_FOUND) qt6_add_resources(cockatrice_RESOURCES_RCC ${cockatrice_RESOURCES}) elseif(Qt5_FOUND)