diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-05-24 12:13:08 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-05-24 12:13:08 +0200 |
| commit | 3b34ac3ccbeb62673b37f0c73cc145fede43c404 (patch) | |
| tree | 7394932681ea2d86db9d9ac63d8fb62c715ae8e7 | |
| parent | 72ab1fb4c1bf363f46470816d8b914a78ac493c4 (diff) | |
| download | turns-3b34ac3ccbeb62673b37f0c73cc145fede43c404.tar.xz turns-3b34ac3ccbeb62673b37f0c73cc145fede43c404.zip | |
gui: add basic frame
| -rw-r--r-- | CMakeLists.txt | 21 | ||||
| -rw-r--r-- | gui/CMakeLists.txt | 48 | ||||
| -rw-r--r-- | gui/src/main.cpp | 11 | ||||
| -rw-r--r-- | lib/CMakeLists.txt | 15 |
4 files changed, 79 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b56670c..dc106d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION "3.31.0") project("turns" LANGUAGES C CXX - DESCRIPTION "A simple turn order tracker" + DESCRIPTION "A simple turn order tracker and support library" VERSION "1.0.0" ) @@ -17,8 +17,26 @@ enable_testing() include("CheckIPOSupported") include("EnableCoverage") +include("FetchContent") include("GNUInstallDirs") +# Global Dependencies + +add_subdirectory("deps/libadwaitamm" SYSTEM) + +FetchContent_Declare( + "Catch2" + URL "https://github.com/catchorg/Catch2/archive/refs/tags/v3.6.0.tar.gz" + URL_HASH "SHA256=485932259a75c7c6b72d4b874242c489ea5155d17efa345eb8cc72159f49f356" + EXCLUDE_FROM_ALL + SYSTEM + FIND_PACKAGE_ARGS +) + +FetchContent_MakeAvailable("Catch2") + +include("Catch") + # Global Settings set(TURNS_GLIB_MINIMUM_VERSION "2.84") @@ -26,6 +44,7 @@ check_ipo_supported(RESULT TURNS_CAN_DO_IPO LANGUAGES CXX) # Sub projects +add_subdirectory("gui") add_subdirectory("lib" SYSTEM) # License diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index ebdb1be..cf7830b 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -1,6 +1,54 @@ # SPDX-FileCopyrightText: 2025 Felix Morgner <felix.morgner@gmail.com> # SPDX-License-Identifier: LGPL-2.1-only +cmake_minimum_required(VERSION "4.0.0") + +project("turns-gui" + LANGUAGES C CXX + DESCRIPTION "Turns, the simple turn order tracker" + VERSION "1.0.0" +) + +include("FetchContent") + +find_package("PkgConfig" REQUIRED) + +# Dependencies + +pkg_check_modules("glibmm" + IMPORTED_TARGET + REQUIRED + "glibmm-2.68>=${TURNS_GLIB_MINIMUM_VERSION}" +) + +# Application + +add_executable("gui" "src/main.cpp") +add_executable("turns::gui" ALIAS "gui") + +target_compile_features("gui" PUBLIC + "c_std_23" + "cxx_std_23" +) + +target_include_directories("gui" PUBLIC + "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" +) + +target_link_libraries("gui" PUBLIC + "adwaitamm::adwaitamm" + "turns::mm" +) + +set_target_properties("gui" PROPERTIES + OUTPUT_NAME "turns" + INTERPROCEDURAL_OPTIMIZATION "${TURNS_CAN_DO_IPO}" + C_EXTENSIONS OFF + CXX_EXTENSIONS OFF +) + +install(TARGETS "gui") + # add_executable("app" # "src/main.cpp" # ) diff --git a/gui/src/main.cpp b/gui/src/main.cpp index a1f9843..dec6b8c 100644 --- a/gui/src/main.cpp +++ b/gui/src/main.cpp @@ -3,6 +3,17 @@ * SPDX-License-Identifier: LGPL-2.1-only */ +#include <giomm/application.h> + +#include <adwaitamm/application.hpp> + +auto main(int argc, char ** argv) -> int +{ + auto app = Adwaita::Application::create("ch.arknet.Turns", Gio::Application::Flags::HANDLES_OPEN); + + return app->run(argc, argv); +} + // #include "turns/core/init.hpp" // #include "turns/core/settings.hpp" // #include "turns/ui/init.hpp" diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 9389743..d27a874 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -32,21 +32,6 @@ pkg_check_modules("glibmm" "glibmm-2.68>=${TURNS_GLIB_MINIMUM_VERSION}" ) -# Testing Dependencies - -FetchContent_Declare( - "Catch2" - URL "https://github.com/catchorg/Catch2/archive/refs/tags/v3.6.0.tar.gz" - URL_HASH "SHA256=485932259a75c7c6b72d4b874242c489ea5155d17efa345eb8cc72159f49f356" - EXCLUDE_FROM_ALL - SYSTEM - FIND_PACKAGE_ARGS -) - -FetchContent_MakeAvailable("Catch2") - -include("Catch") - # Library set(HEADERS |
