summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt21
-rw-r--r--gui/CMakeLists.txt48
-rw-r--r--gui/src/main.cpp11
-rw-r--r--lib/CMakeLists.txt15
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