summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-03-18 15:51:50 -0400
committerLouie S <louie@example.com>2024-03-18 15:51:50 -0400
commit28fd4ebfca32aacd53a17b9a6a92ba97011f2e3a (patch)
treec9727276ddef1bef7fb08dacbbab7890c4bdfad2
parent4f6bf0f32483f524f2f654c9eaf9274d8e85af77 (diff)
Basic Linux install target working
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.txt9
-rw-r--r--data/assignment-list.desktop7
-rw-r--r--data/assignment-list.desktop.in8
4 files changed, 18 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index 517f101..456fc17 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
build
compile_commands.json
config.h
+data/assignment-list.desktop
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a87c05..682132b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,3 +97,12 @@ add_executable(assignment-list
set_target_properties(assignment-list PROPERTIES WIN32_EXECUTABLE ON)
target_link_libraries(assignment-list ${qt_libraries})
+
+# Installation
+install(TARGETS assignment-list)
+
+# TODO make conditional only for linux
+# install desktop entry and icon
+configure_file(data/assignment-list.desktop.in ${CMAKE_CURRENT_SOURCE_DIR}/data/assignment-list.desktop @ONLY)
+install(FILES data/assignment-list.desktop DESTINATION share/applications)
+install(FILES data/assignment-list.svg DESTINATION share/pixmaps)
diff --git a/data/assignment-list.desktop b/data/assignment-list.desktop
deleted file mode 100644
index 79c5bf6..0000000
--- a/data/assignment-list.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=assignment-list
-Comment=Assignment List Qt
-Exec=assignment-list
-Icon=assignment-list
-Categories=Utility
diff --git a/data/assignment-list.desktop.in b/data/assignment-list.desktop.in
new file mode 100644
index 0000000..1fbe91a
--- /dev/null
+++ b/data/assignment-list.desktop.in
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Type=Application
+Name=@PROJECT_NAME@
+Comment=Assignment List Qt
+Path=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/@PROJECT_NAME@
+Exec=@PROJECT_NAME@
+Icon=assignment-list
+Categories=Utility