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.
This commit is contained in:
Owen D'Aprile 2022-09-25 15:11:22 -04:00
parent 6bc1cbeec3
commit 74b00570dd
No known key found for this signature in database
GPG Key ID: 291B46C15C77F8C3

View File

@ -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