From a8ab7af9c2672dcd03781688993a1692e6444715 Mon Sep 17 00:00:00 2001 From: Bart Ribbers Date: Tue, 9 May 2023 10:34:53 +0200 Subject: 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 --- CMakeLists.txt | 7 +++++++ asteroid-compass.desktop.template | 2 +- asteroid-compass.in | 3 +++ src/CMakeLists.txt | 4 ++-- 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100755 asteroid-compass.in 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}) -- cgit v1.2.3-54-g00ecf