summaryrefslogtreecommitdiff
path: root/res/CMakeLists.txt
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2024-07-11 13:17:03 +0200
committerFelix Morgner <felix.morgner@gmail.com>2024-07-11 16:03:04 +0200
commitf597be870eec6d04de6bed0effa7dd23bcb72bf8 (patch)
tree569ceeeef1bbf143b0d3a32ccf9a2fc716ff13e1 /res/CMakeLists.txt
downloadturns-f597be870eec6d04de6bed0effa7dd23bcb72bf8.tar.xz
turns-f597be870eec6d04de6bed0effa7dd23bcb72bf8.zip
initial commit
Diffstat (limited to 'res/CMakeLists.txt')
-rw-r--r--res/CMakeLists.txt44
1 files changed, 44 insertions, 0 deletions
diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt
new file mode 100644
index 0000000..4969787
--- /dev/null
+++ b/res/CMakeLists.txt
@@ -0,0 +1,44 @@
+# Library
+
+add_library("res")
+
+target_add_glib_resources("res"
+ PREFIX "turns"
+ UI_FILES
+ "windows/main_window.ui"
+)
+
+target_compile_options("res" PRIVATE
+ "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:-fprofile-arcs>"
+ "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:-ftest-coverage>"
+)
+
+target_link_libraries("res" PUBLIC
+ "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:gcov>"
+
+ "PkgConfig::adwaita"
+ "PkgConfig::gtkmm"
+)
+
+target_link_options("res" PRIVATE
+ "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:--coverage>"
+)
+
+add_library("turns::res" ALIAS "res")
+
+# Tests
+
+add_executable("res-tests"
+ "tests/main.cpp"
+ "tests/windows.cpp"
+)
+
+target_link_libraries("res-tests"
+ "Catch2::Catch2"
+
+ "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wl,--whole-archive>"
+ "turns::res"
+ "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wl,--no-whole-archive>"
+)
+
+catch_discover_tests("res-tests") \ No newline at end of file