summaryrefslogtreecommitdiff
path: root/app/CMakeLists.txt
diff options
context:
space:
mode:
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