From 74b00570ddee65d134a7d95f87c11b2458a64821 Mon Sep 17 00:00:00 2001 From: Owen D'Aprile Date: Sun, 25 Sep 2022 15:11:22 -0400 Subject: [PATCH] build: allow setting installation prefix Allow $PREFIX to be set during compilation, changing where the app is installed. This is used to change where the app is installed inside the Flatpak sandbox. --- samplebrain.pro | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/samplebrain.pro b/samplebrain.pro index 58ec2bc..ea4957b 100644 --- a/samplebrain.pro +++ b/samplebrain.pro @@ -50,12 +50,17 @@ QMAKE_CXXFLAGS += -O3 -Wall -Wno-unused -std=c++11 # assets RESOURCES = app/samplebrain.qrc -unix:desktopfile.path = /usr/share/applications/ +PREFIX = $$(PREFIX) +isEmpty(PREFIX) { + PREFIX = /usr +} + +unix:desktopfile.path = $$PREFIX/share/applications/ unix:desktopfile.files = desktop/samplebrain.desktop -unix:iconfile.path = /usr/share/icons/hicolor/scalable/apps +unix:iconfile.path = $$PREFIX/share/icons/hicolor/scalable/apps unix:iconfile.files = desktop/samplebrain.svg -target.path = /usr/bin +target.path = $$PREFIX/bin INSTALLS += target desktopfile iconfile