From 5930952ec663f9181341452e49ce772cfe57109f Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 5 Jan 2022 09:42:26 +0800 Subject: [PATCH] auto generate desktop file using qmake --- Red_Panda_CPP.pro | 6 ++++++ linux/redpandaide.desktop => redpandaide.desktop.in | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) rename linux/redpandaide.desktop => redpandaide.desktop.in (75%) diff --git a/Red_Panda_CPP.pro b/Red_Panda_CPP.pro index 549091a7..1d354145 100644 --- a/Red_Panda_CPP.pro +++ b/Red_Panda_CPP.pro @@ -13,6 +13,8 @@ linux: { PREFIX = /usr/local } + QMAKE_SUBSTITUTES += redpandaide.desktop.in + resources.path = $${PREFIX}/share/$${APP_NAME} resources.files += linux/templates INSTALLS += resources @@ -27,4 +29,8 @@ linux: { pixmaps.files += linux/redpandaide.png INSTALLS += pixmaps + desktop.path = $${PREFIX}/share/applications + desktop.files += redpandaide.desktop + INSTALLS += desktop + } diff --git a/linux/redpandaide.desktop b/redpandaide.desktop.in similarity index 75% rename from linux/redpandaide.desktop rename to redpandaide.desktop.in index 4077565f..4c117353 100644 --- a/linux/redpandaide.desktop +++ b/redpandaide.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Comment=A lightweighted QT-based C/C++ IDE Comment[zh_CN]=基于QT的轻量级C/C++集成开发环境 -Exec=/opt/RedPandaIDE/bin/RedPandaIDE %F +Exec=RedPandaIDE %F GenericName=Red Panda C++ GenericName[zh_CN]=小熊猫C++ MimeType=application/pdf @@ -11,5 +11,5 @@ StartupNotify=false Terminal=false Type=Application Categories=Development;Qt; -Icon=/opt/RedPandaIDE/redpandaide.png -Path=/opt/RedPandaIDE/bin +Icon=$${PREFIX}/share/pixmaps/redpandaide.png +Path=$${PREFIX}/bin