aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Ribbers <bribbers@disroot.org>2023-05-09 10:34:53 +0200
committerMagneFire <dgriet@gmail.com>2023-05-14 19:38:37 +0200
commita8ab7af9c2672dcd03781688993a1692e6444715 (patch)
tree29acc5fa8c8cfacaa7eeceb3017cd26a9ffbbaf0
parent23d104e70c9991f7b383a6c021b65c2f19a99d39 (diff)
Move main library file to CMAKE_INSTALL_LIBDIR and add a launch script
Previously the main program file was installed to /usr/bin, mistakingly giving the impression it could be executed as is. However it isn't a binary but a library that gets executed through invoker. To prevent confusion move it to /usr/lib and add a launch script to /usr/bin instead which launches it through invoker
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt7
-rw-r--r--asteroid-compass.desktop.template2
-rwxr-xr-xasteroid-compass.in3
-rw-r--r--src/CMakeLists.txt4
4 files changed, 13 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0a7ab72..3b27f88 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,6 +19,13 @@ ecm_find_qmlmodule(QtSensors 5.3)
add_subdirectory(src)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/asteroid-compass.in
+ ${CMAKE_BINARY_DIR}/asteroid-compass
+ @ONLY)
+
+install(PROGRAMS ${CMAKE_BINARY_DIR}/asteroid-compass
+ DESTINATION ${CMAKE_INSTALL_BINDIR})
+
build_translations(i18n)
generate_desktop(${CMAKE_SOURCE_DIR} asteroid-compass)
diff --git a/asteroid-compass.desktop.template b/asteroid-compass.desktop.template
index 9461686..180fab0 100644
--- a/asteroid-compass.desktop.template
+++ b/asteroid-compass.desktop.template
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Categories=Applications;
-Exec=invoker --single-instance --type=qtcomponents-qt5 /usr/bin/asteroid-compass
+Exec=asteroid-compass
Icon=ios-compass-outline
X-Asteroid-Center-Color=#29A600
X-Asteroid-Outer-Color=#070C00
diff --git a/asteroid-compass.in b/asteroid-compass.in
new file mode 100755
index 0000000..77c198c
--- /dev/null
+++ b/asteroid-compass.in
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec invoker --single-instance --type=qtcomponents-qt5 @CMAKE_INSTALL_FULL_LIBDIR@/asteroid-compass.so
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a9ef740..b5930c5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,8 +1,8 @@
add_library(asteroid-compass main.cpp resources.qrc)
-set_target_properties(asteroid-compass PROPERTIES PREFIX "" SUFFIX "")
+set_target_properties(asteroid-compass PROPERTIES PREFIX "")
target_link_libraries(asteroid-compass PUBLIC
AsteroidApp)
install(TARGETS asteroid-compass
- DESTINATION ${CMAKE_INSTALL_BINDIR})
+ DESTINATION ${CMAKE_INSTALL_LIBDIR})