summaryrefslogtreecommitdiff
path: root/app/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 /app/CMakeLists.txt
downloadturns-f597be870eec6d04de6bed0effa7dd23bcb72bf8.tar.xz
turns-f597be870eec6d04de6bed0effa7dd23bcb72bf8.zip
initial commit
Diffstat (limited to 'app/CMakeLists.txt')
-rw-r--r--app/CMakeLists.txt54
1 files changed, 54 insertions, 0 deletions
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
new file mode 100644
index 0000000..88dea68
--- /dev/null
+++ b/app/CMakeLists.txt
@@ -0,0 +1,54 @@
+# Library
+
+add_library("app"
+ "src/application.cpp"
+)
+
+add_library("turns::app" ALIAS "app")
+
+target_compile_options("app" PUBLIC
+ "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wall>"
+ "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wextra>"
+ "$<$<CXX_COMPILER_ID:GNU,Clang>:-Werror>"
+ "$<$<CXX_COMPILER_ID:GNU,Clang>:-pedantic-errors>"
+)
+
+target_include_directories("app" PUBLIC
+ "include"
+)
+
+target_link_libraries("app" PUBLIC
+ "PkgConfig::adwaita"
+ "PkgConfig::gtkmm"
+
+ "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wl,--whole-archive>"
+ "turns::res"
+ "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wl,--no-whole-archive>"
+)
+
+# Application
+
+add_executable("exe"
+ "src/main.cpp"
+)
+
+target_link_libraries("exe" PRIVATE
+ "turns::app"
+)
+
+set_target_properties("exe" PROPERTIES
+ OUTPUT_NAME "turns"
+)
+
+install(TARGETS "exe"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+)
+
+configure_file("desktop.in"
+ "turns.desktop"
+)
+
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/turns.desktop"
+ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
+) \ No newline at end of file