From 730e633d07aaff6030099b77db39037fefd9d0be Mon Sep 17 00:00:00 2001 From: Vasily Date: Mon, 29 Jul 2019 14:02:42 +0200 Subject: [PATCH] Add naive `make install` for Linux This enables a `sudo make install` that copies the build directory to the PREFIX directory (/opt/OpenVR-AdvancedSettings/AdvancedSettings by default). The entire directory is being copied because Qt is incredibly weird about how the INSTALLS variable works. From testing it appears that only files that exist before the build process has started (even the file_copy process) will be eligible for installation. If the /OpenVR-AdvancedSettings/ directory is excluded, Qt will attempt to remove the /opt/ folder on `make uninstall`, this is obviously not desirable. --- advancedSettings.pro | 13 +++++++++++++ docs/building_for_linux.md | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/advancedSettings.pro b/advancedSettings.pro index 93a1e3b..539753a 100644 --- a/advancedSettings.pro +++ b/advancedSettings.pro @@ -94,3 +94,16 @@ win32 { # for running executables. QMAKE_POST_LINK = cmd /c $$WINDEPLOYQT_FULL_LINE } + +# Add make install support +unix { + isEmpty(PREFIX){ + PREFIX = /opt/OpenVR-AdvancedSettings + } + + application.path = $$PREFIX + application.files = $$COPY_DEST_DIR + + INSTALLS += application +} + diff --git a/docs/building_for_linux.md b/docs/building_for_linux.md index 391453f..5b710b1 100644 --- a/docs/building_for_linux.md +++ b/docs/building_for_linux.md @@ -13,6 +13,7 @@ * [Ubuntu 18.04 Bionic](#ubuntu-1804-bionic) - [Locations and Environment Variables](#locations-and-environment-variables) - [Building](#building) +- [Installing](#installing) - [Contributing](#contributing) # Requirements @@ -175,6 +176,12 @@ With the programs above installed and environment variables set, go into the roo If you copy the `third-party/openvr/lib/linux64/libopenvr_api.so` file into `/lib` you can run the `AdvancedSettings` file without anything else. Otherwise you'll need to run the `run-with-library.sh` file. +# Installing + +The application can be installed by running `sudo make install` in the directory of the `Makefile`. +This will copy the build directory to `/opt/OpenVR-AdvancedSettings/AdvancedSettings` by default. +The `PREFIX` location can be changed while running `qmake` by writing `qmake PREFIX=/your/dir/here`, then `make` and `sudo make install`. + # Contributing For full details, see [CONTRIBUTING.md](CONTRIBUTING.md).