summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Ribbers <bribbers@disroot.org>2023-05-09 10:49:32 +0200
committerMagneFire <dgriet@gmail.com>2023-05-14 19:38:55 +0200
commitc206053240d39ba1ae3b045566274bde3b40ad3e (patch)
tree373213c31f893740f423fa26ffc8760ac991a7c1
parente78b0968ae9ab48a815319b8f6d87ac0e9df95b7 (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
-rw-r--r--CMakeLists.txt7
-rw-r--r--asteroid-helloworld.desktop.template2
-rw-r--r--asteroid-helloworld.in3
-rw-r--r--src/CMakeLists.txt4
4 files changed, 13 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a227e4c..8b7965f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,13 @@ include(AsteroidTranslations)
add_subdirectory(src)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/asteroid-helloworld.in
+ ${CMAKE_BINARY_DIR}/asteroid-helloworld
+ @ONLY)
+
+install(PROGRAMS ${CMAKE_BINARY_DIR}/asteroid-helloworld
+ DESTINATION ${CMAKE_INSTALL_BINDIR})
+
generate_desktop(${CMAKE_SOURCE_DIR} asteroid-helloworld)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/asteroid-helloworld.desktop.template b/asteroid-helloworld.desktop.template
index ffd1aed..7276d69 100644
--- a/asteroid-helloworld.desktop.template
+++ b/asteroid-helloworld.desktop.template
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Categories=Applications;
-Exec=invoker --single-instance --type=qtcomponents-qt5 /usr/bin/asteroid-helloworld
+Exec=asteroid-helloworld
Icon=ios-pulse-outline
X-Asteroid-Center-Color=#b04d1c
X-Asteroid-Outer-Color=#421c0a
diff --git a/asteroid-helloworld.in b/asteroid-helloworld.in
new file mode 100644
index 0000000..32e82d2
--- /dev/null
+++ b/asteroid-helloworld.in
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec invoker --single-instance --type=qtcomponents-qt5 @CMAKE_INSTALL_FULL_LIBDIR@/asteroid-helloworld.so
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ef093a5..c6b802c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,8 +1,8 @@
add_library(asteroid-helloworld main.cpp resources.qrc)
-set_target_properties(asteroid-helloworld PROPERTIES PREFIX "" SUFFIX "")
+set_target_properties(asteroid-helloworld PROPERTIES PREFIX "")
target_link_libraries(asteroid-helloworld PUBLIC
AsteroidApp)
install(TARGETS asteroid-helloworld
- DESTINATION ${CMAKE_INSTALL_BINDIR})
+ DESTINATION ${CMAKE_INSTALL_LIBDIR})