From 1ea554ccb43035300769ddae804435f16baabd4d Mon Sep 17 00:00:00 2001 From: Vasily Date: Sun, 24 Feb 2019 17:34:43 +0100 Subject: [PATCH] Update docs on building on Linux --- Readme.md | 5 +---- docs/building_for_linux.md | 43 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 docs/building_for_linux.md diff --git a/Readme.md b/Readme.md index bdfbc03..0c06ee1 100644 --- a/Readme.md +++ b/Readme.md @@ -291,10 +291,7 @@ Full build instructions can be found [here](docs/building_for_windows.md). ## Building on Linux -If you want to run Advanced Settings on linux you can build it yourself using `qmake` and `make` or using Qt Creator, you'll have to copy the `res` folder from the `src` folder into folder that contains the binary -and copy `third-party/openvr/lib/linux64/libopenvr_api.so` into your systems library path. - -If you want to contribute changes running `clang-format` is necessary. More details are in the [CONTRIBUTING.md](docs/CONTRIBUTING.md) file. +Full build instructions can be found [here](docs/building_for_linux.md). # Notes: diff --git a/docs/building_for_linux.md b/docs/building_for_linux.md new file mode 100644 index 0000000..3e987a1 --- /dev/null +++ b/docs/building_for_linux.md @@ -0,0 +1,43 @@ +# Building for Linux + +- [Requirements](#requirements) +- [Locations and Environment Variables](#locations-and-environment-variables) +- [Building](#building) +- [Contributing](#contributing) + +## Requirements + +The following packages are necessary for compiling: + +`sudo apt install build-essential qtbase5-dev qttools5-dev qtdeclarative5-dev qtmultimedia5-dev qt5-default qttools5-dev-tools` + +If you install Qt 5.12 you should have the above packages. + +Along with either `clang` or `g++`. At least `g++-7` is required, due to C++17 support. + +For linting with `clang-tidy` the following are necessary: + +`sudo apt install bear clang-tidy` + +All applications are required to be in the `PATH`. + +## Locations and Environment Variables + +The following environmental variables are relevant for building the project. + +| Environment Variable | Purpose | +| -------------------- | ------------- | +| `QMAKE_SPEC` | The [mkspec](https://forum.qt.io/topic/70970/what-is-mkspecs-used-for-how-to-configure-for-my-hardware) to compile to. Either `linux-g++` or `linux-clang`. Defaults to `linux-g++`. | +| `USE_TIDY` | If set a compilation database will be created and the project linted. Can only be used with `clang`. | + +If an environment variable isn't set a default value will be provided. The default values are shown in the table below. + +## Building + +With the programs above installed and environment variables set, go into the root folder of the repository and run `./build_scripts/linux/build_linux.sh`. + +You'll have to copy the `res` directory into the resulting binary location, and add `third-party/openvr/lib/linux64/libopenvr_api.so` to your systems library path. + +## Contributing + +For full details, see [CONTRIBUTING.md](CONTRIBUTING.md).