From 1f7fb26ceaa5d05c4c62cc6d110d5344708ab468 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 28 Apr 2025 15:46:25 +0200 Subject: demo: add simple demo application --- .gitignore | 3 ++- CMakeLists.txt | 4 +++- demo/CMakeLists.txt | 7 +++++++ demo/src/main.cpp | 18 ++++++++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 demo/CMakeLists.txt create mode 100644 demo/src/main.cpp diff --git a/.gitignore b/.gitignore index 42afabf..fb370db 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/build \ No newline at end of file +/build +/leaks.log \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c0aaec..0d7246c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ target_include_directories("adwaitamm" PUBLIC "$" ) -target_include_directories("adwaitamm" PUBLIC SYSTEM +target_include_directories("adwaitamm" SYSTEM PUBLIC "$" ) @@ -67,3 +67,5 @@ install(TARGETS "adwaitamm" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) + +add_subdirectory("demo") \ No newline at end of file diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt new file mode 100644 index 0000000..ce0f2d6 --- /dev/null +++ b/demo/CMakeLists.txt @@ -0,0 +1,7 @@ +add_executable("demo" + "src/main.cpp" +) + +target_link_libraries("demo" PRIVATE + "adwaitamm::adwaitamm" +) \ No newline at end of file diff --git a/demo/src/main.cpp b/demo/src/main.cpp new file mode 100644 index 0000000..bb8a991 --- /dev/null +++ b/demo/src/main.cpp @@ -0,0 +1,18 @@ +#include + +#include +#include + +auto main(int argc, char ** argv) -> int +{ + auto app = Adwaita::Application::create("ch.arknet.libadwaitamm.demo", Gtk::Application::Flags::NON_UNIQUE); + + app->signal_startup().connect([app] { + auto window = new Adwaita::ApplicationWindow{*app}; + window->present(); + + app->signal_shutdown().connect([window] { delete window; }); + }); + + return app->run(argc, argv); +} \ No newline at end of file -- cgit v1.2.3