Files
uno-game/CMakeLists.txt
Kieran Kihn 095a34af1c chore: integrate Slint UI framework and update build configuration
- Added Slint as a required dependency in the CMake configuration.
- Integrated Slint sources into `uno-game-lib`.
- Modified Windows debug build to create a GUI executable.
2025-12-09 20:05:35 +08:00

50 lines
1.3 KiB
CMake

cmake_minimum_required(VERSION 4.0)
project(uno-game)
set(CMAKE_CXX_STANDARD 26)
find_package(nlohmann_json REQUIRED)
find_package(asio REQUIRED)
find_package(argparse REQUIRED)
find_package(Slint REQUIRED)
add_library(uno-game-lib
src/game/Card.cpp
src/game/CardTile.cpp
src/game/Player.cpp
src/game/GameState.cpp
src/common/Utils.cpp
src/network/Message.cpp
src/network/MessageSerializer.cpp
src/network/NetworkServer.cpp
src/network/NetworkClient.cpp
src/client/UnoClient.cpp
src/server/UnoServer.cpp
src/network/Session.cpp
)
target_link_libraries(uno-game-lib
PUBLIC nlohmann_json::nlohmann_json
)
target_link_libraries(uno-game-lib
PUBLIC asio::asio
)
target_link_libraries(uno-game-lib PUBLIC Slint::Slint)
slint_target_sources(uno-game-lib src/ui/MainWindow.slint)
add_executable(uno-client src/client/main.cpp)
target_link_libraries(uno-client
PRIVATE uno-game-lib)
if (WIN32 AND CMAKE_BUILD_TYPE STREQUAL "DEBUG")
set_target_properties(uno-client PROPERTIES WIN32_EXECUTABLE ON)
endif ()
add_executable(uno-server src/server/main.cpp)
target_link_libraries(uno-server
PRIVATE uno-game-lib)
target_link_libraries(uno-server
PRIVATE argparse::argparse
)
add_subdirectory(test)