Skip to content

Commit e69fba6

Browse files
OlafRocketclaude
andcommitted
docs: simplify build guides and pin vcpkg
- Require Ninja as the CMake generator on all platforms; remove the "Faster builds with Ninja (optional)" sections and the Visual Studio generator option on Windows. - Pin vcpkg to commit c2aeddd80357b17592e59ad965d2adf65a19b22f in all three guides for reproducible dependency builds. - Document CMakeUserPresets.json as the single way to point CMake at the local Qt 6.5.3 install; drop the Qt6_DIR env-var and one-off -DQt6_DIR command-line paths. - Note that --target package on Windows is slow and recommend a plain cmake --build build for dev iteration. - Remove docs/reference/build_guides/developer_tips.md and the link to it from windows.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 8ab7f45 commit e69fba6

4 files changed

Lines changed: 64 additions & 190 deletions

File tree

docs/reference/build_guides/developer_tips.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/reference/build_guides/linux_generic.md

Lines changed: 25 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,24 @@ xSTUDIO can be built in just a few steps on many Linux distros by employing Micr
44

55
### Base dependencies
66

7-
We assume that you have some knowledge of development on Linux platforms and have git, gcc & cmake installed on your system.
7+
We assume that you have some knowledge of development on Linux platforms and have git, gcc and cmake installed on your system. You also need Ninja, which xSTUDIO uses as its CMake generator on all platforms. Install it via your distro's package manager:
8+
9+
# Rocky / RHEL / Fedora
10+
sudo dnf install ninja-build
11+
12+
# Ubuntu / Debian
13+
sudo apt install ninja-build
814

915
### Download and install Qt 6.5.3 SDK
1016

1117
Follow [these instructions](downloading_qt.md) - ensuring that you download the SDK for Linux platforms (rather than the MacOS platform used as an example in the linked guide).
1218

1319
### Download the VCPKG repo
1420

15-
To build xSTUDIO we need a number of other open source software packages. We use the VCPKG package manager to do this. All that we need to do is download the repo and run the bootstrap script before we build xstudio. Run these commands in the Powershell:
21+
To build xSTUDIO we need a number of other open source software packages. We use the VCPKG package manager to do this. All that we need to do is download the repo and run the bootstrap script before we build xstudio. Run these commands in a terminal:
1622

1723
git clone https://github.com/microsoft/vcpkg.git
24+
git -C vcpkg checkout c2aeddd80357b17592e59ad965d2adf65a19b22f
1825
./vcpkg/bootstrap-vcpkg.sh
1926

2027
### Download the xSTUDIO repo
@@ -27,74 +34,34 @@ Download from github in the usual manner. Enter the root folder of the repo and
2734

2835
### Tell CMake where Qt is installed
2936

30-
CMake needs to know where your Qt 6.5.3 SDK is installed. The simplest way is to set the `Qt6_DIR` environment variable in your shell, before launching the build comman. For example, if user Mary Jane downloaded Qt into her home folder:
31-
32-
export Qt6_DIR=/home/maryjane/Qt/6.5.3/gcc_64/lib/cmake/Qt6
33-
34-
Optionally, add this to your `~/.bashrc` (or `~/.zshrc`) so it's set in every new shell.
35-
36-
If you prefer not to use an environment variable, alternative options are:
37-
38-
- **Per-machine user preset**: create a `CMakeUserPresets.json` file alongside `CMakePresets.json` in the repo root. The user preset should have a different name from the tracked preset it inherits from, and add `Qt6_DIR` to `cacheVariables`. For example:
37+
CMake needs to know where your Qt 6.5.3 SDK is installed. Create a `CMakeUserPresets.json` file alongside `CMakePresets.json` in the repo root. This file is gitignored, so your local path won't be committed. The user preset should have a different name from the tracked preset it inherits from, and add `Qt6_DIR` to `cacheVariables`. For example, if user Mary Jane downloaded Qt into her home folder:
3938

39+
{
40+
"version": 3,
41+
"configurePresets": [
4042
{
41-
"version": 3,
42-
"configurePresets": [
43-
{
44-
"name": "LinuxReleaseLocal",
45-
"inherits": "LinuxRelease",
46-
"cacheVariables": {
47-
"Qt6_DIR": "/home/maryjane/Qt/6.5.3/gcc_64/lib/cmake/Qt6"
48-
}
49-
}
50-
]
43+
"name": "LinuxNinjaReleaseLocal",
44+
"inherits": "LinuxNinjaRelease",
45+
"cacheVariables": {
46+
"Qt6_DIR": "/home/maryjane/Qt/6.5.3/gcc_64/lib/cmake/Qt6"
47+
}
5148
}
49+
]
50+
}
5251

53-
See the [CMake presets documentation](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) for the full format reference.
54-
55-
- **One-off command-line override**: pass `-DQt6_DIR=/path/to/Qt6` directly to the `cmake` command below.
52+
See the [CMake presets documentation](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) for the full format reference.
5653

5754
### Build xSTUDIO
5855

5956
First, we configure for building. Note that this cmake command ***may take several hours to complete*** the first time it is run, though subsequently it will take a few seconds. This is because xSTUDIO's dependencies (particularly ffmpeg) take a long time to download and build from the source code, which is what VCPKG is doing.
6057

61-
- If you are using an environment variable to specify the Qt installation run:
62-
63-
cmake -B build --preset LinuxRelease
64-
65-
- If you are using a `CMakeUserPresets.json` file to point at your Qt installation (see the previous section), run instead:
66-
67-
cmake -B build --preset LinuxReleaseLocal
68-
69-
- Or, to pass the Qt path as a one-off command-line override:
70-
71-
cmake -B build --preset LinuxRelease -DQt6_DIR=/home/maryjane/Qt/6.5.3/gcc_64/lib/cmake/Qt6
72-
73-
When this has finished, you can build xSTUDIO with this command (in this case, the --parallel flag is set for a machine with 16 cores as an example).
74-
75-
cmake --build build --parallel 16
76-
77-
### Faster builds with Ninja (optional)
78-
79-
To speed up the build, you can use Ninja instead of make. Ninja parallelises the build at the file level and is noticeably faster. Install it via your platform's package manager:
80-
81-
# Rocky / RHEL / Fedora
82-
sudo dnf install ninja-build
83-
84-
# Ubuntu / Debian
85-
sudo apt install ninja-build
86-
87-
# macOS (Homebrew)
88-
brew install ninja
89-
90-
On Windows, Ninja is already bundled with Visual Studio's CMake tools, so no separate install is needed.
58+
cmake -B build --preset LinuxNinjaReleaseLocal
9159

92-
Ninja-based presets are provided for Linux, macOS and Windows (Release, RelWithDebInfo and Debug variants for each). For example, to configure a Linux release build:
60+
When this has finished, you can build xSTUDIO with:
9361

94-
cmake -B build --preset LinuxNinjaRelease
9562
cmake --build build
9663

97-
Ninja handles parallelism automatically so there is no need for the `--parallel` flag. See [CMakePresets.json](../../../CMakePresets.json) for the full list of available presets.
64+
RelWithDebInfo and Debug variants are also available — see [CMakePresets.json](../../../CMakePresets.json) for the full list.
9865

9966
### Running xSTUDIO in a dev environment
10067

@@ -106,4 +73,4 @@ Run this from the xstudio repository root. The `python3.11` segment tracks which
10673

10774
### Installing xSTUDIO
10875

109-
Correct packaging and installation of xstudio and its dependencies across various Linux distros is a problem we are still working on! For now, it is up to individual developers to do an effective installation on their system. You can try running 'make install' from the 'build' folder. Use -DCMAKE_BUILD_PREFIX={path} to set a test installation location
76+
Correct packaging and installation of xstudio and its dependencies across various Linux distros is a problem we are still working on! For now, it is up to individual developers to do an effective installation on their system. You can try running `cmake --install build` from the repository root. Use -DCMAKE_BUILD_PREFIX={path} to set a test installation location

docs/reference/build_guides/macos.md

Lines changed: 20 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ Some of xSTUDIO's dependencies require 'homebrew', the MacOS open source softwar
1212

1313
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
1414

15-
We require 6 packages to be installed to proceed. Run these commands in a terminal:
15+
We require these packages to be installed to proceed. xSTUDIO uses Ninja as its CMake generator on all platforms, so install it here as well. Run these commands in a terminal:
1616

1717
brew install cmake
18+
brew install ninja
1819
brew install pkg-config
1920
brew install nasm
2021
brew install autoconf
@@ -29,6 +30,7 @@ Follow [these instructions](downloading_qt.md)
2930
To build xSTUDIO we need a number of other open source software packages. We use the VCPKG package manager to do this. All that we need to do is download the repo and run the bootstrap script before we build xstudio. Run these commands in a terminal:
3031

3132
git clone https://github.com/microsoft/vcpkg.git
33+
git -C vcpkg checkout c2aeddd80357b17592e59ad965d2adf65a19b22f
3234
./vcpkg/bootstrap-vcpkg.sh
3335

3436
### Download the xSTUDIO repo
@@ -41,64 +43,33 @@ Download from github in the usual manner. Enter the root folder of the repo and
4143

4244
### Tell CMake where Qt is installed
4345

44-
CMake needs to know where your Qt 6.5.3 SDK is installed. The simplest way is to set the `Qt6_DIR` environment variable in your shell, pointing to a directory named 'Qt6' which is in a directory named 'cmake', which is in a directory named 'lib'. For example, on MacOS where user Mary Jane downloaded Qt into her home folder:
45-
46-
export Qt6_DIR=/Users/maryjane/Qt/6.5.3/macos/lib/cmake/Qt6
47-
48-
Add this to your `~/.zshrc` (or `~/.bash_profile`) so it's set in every new shell.
49-
50-
Alternative options if you prefer not to use an environment variable:
51-
52-
- **Per-machine user preset**: create a `CMakeUserPresets.json` file alongside `CMakePresets.json` in the repo root. This file is gitignored, so your local path won't be committed. The user preset should have a different name from the tracked preset it inherits from, and add `Qt6_DIR` to `cacheVariables`. For example:
46+
CMake needs to know where your Qt 6.5.3 SDK is installed. Create a `CMakeUserPresets.json` file alongside `CMakePresets.json` in the repo root. This file is gitignored, so your local path won't be committed. The user preset should have a different name from the tracked preset it inherits from, and add `Qt6_DIR` to `cacheVariables`. For example, if user Mary Jane downloaded Qt into her home folder:
5347

48+
{
49+
"version": 3,
50+
"configurePresets": [
5451
{
55-
"version": 3,
56-
"configurePresets": [
57-
{
58-
"name": "MacOSReleaseLocal",
59-
"inherits": "MacOSRelease",
60-
"cacheVariables": {
61-
"Qt6_DIR": "/Users/maryjane/Qt/6.5.3/macos/lib/cmake/Qt6"
62-
}
63-
}
64-
]
52+
"name": "MacOSNinjaReleaseLocal",
53+
"inherits": "MacOSNinjaRelease",
54+
"cacheVariables": {
55+
"Qt6_DIR": "/Users/maryjane/Qt/6.5.3/macos/lib/cmake/Qt6"
56+
}
6557
}
58+
]
59+
}
6660

67-
See the [CMake presets documentation](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) for the full format reference.
68-
69-
- **One-off command-line override**: pass `-DQt6_DIR=/path/to/Qt6` directly to the `cmake` command below.
61+
For an Intel Mac, inherit from `MacOSIntelNinjaRelease` instead. See the [CMake presets documentation](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) for the full format reference.
7062

7163
### Build xSTUDIO
7264

73-
Run the appropriate command for your platform (whether you have an older Intel or a newer Apple Silicon machine) to set-up for building. Note that this cmake command ***may take several hours to complete***. This is because xSTUDIO's dependencies (particularly ffmpeg) take a long time to download and build from the source code, which is what VCPKG is doing.
74-
75-
**Apple Silicon (ARM) Machines:**
76-
77-
cmake -B build --preset MacOSRelease
78-
79-
**Intel Machines:**
80-
81-
cmake -B build --preset MacOSIntelRelease
65+
Run the configure command. Note that this cmake command ***may take several hours to complete***. This is because xSTUDIO's dependencies (particularly ffmpeg) take a long time to download and build from the source code, which is what VCPKG is doing.
8266

83-
Or, if you are using a `CMakeUserPresets.json` file to point at your Qt installation (see the previous section), run the matching local preset instead, e.g.:
67+
cmake -B build --preset MacOSNinjaReleaseLocal
8468

85-
cmake -B build --preset MacOSReleaseLocal
69+
When this has finished, you can build xSTUDIO with:
8670

87-
When this has finished, you can build xSTUDIO with this command.
71+
cmake --build build --target install
8872

89-
cmake --build build --parallel 16 --target install
73+
RelWithDebInfo and Debug variants are also available — see [CMakePresets.json](../../../CMakePresets.json) for the full list.
9074

9175
If the build is successful, you should have an application bundle in the 'build' folder called 'xSTUDIO.app'. This can be drag & dropped into your applications folder, desktop and dock as for any other application.
92-
93-
### Faster builds with Ninja (optional)
94-
95-
To speed up the build, you can use Ninja instead of make. Ninja parallelises the build at the file level and is noticeably faster. Install it via Homebrew:
96-
97-
brew install ninja
98-
99-
Ninja-based presets are provided for macOS (Release, RelWithDebInfo and Debug variants). For example, to configure a macOS release build:
100-
101-
cmake -B build --preset MacOSNinjaRelease
102-
cmake --build build --target install
103-
104-
Ninja handles parallelism automatically so there is no need for the `--parallel` flag. See [CMakePresets.json](../../../CMakePresets.json) for the full list of available presets.

0 commit comments

Comments
 (0)