From c3fa043ae560289759b6f836ac62736d97ba91bf Mon Sep 17 00:00:00 2001 From: David Gumberg Date: Wed, 12 Feb 2025 12:43:49 -0800 Subject: [PATCH] doc: build: Fix instructions for msvc gui builds If the instructions are followed as-is, and "Developer (PowerShell|Command Prompt) for VS 2022" is used to execute the suggested build commands, the root directory of vcpkg (e.g. in VS 2022 Community edition: `C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg`), is too long, and when vcpkg attempts to build any of the QT packages, it will fail because of build steps that require path lengths greater than Windows' `MAX_PATH` 260 character limit. This can be avoided without needing to move the vcpkg root dir by setting `--x-buildtrees-root` to a short path, like `C:\vcpkg`. --- doc/build-windows-msvc.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/build-windows-msvc.md b/doc/build-windows-msvc.md index 482b7a7d1fbb3..915cf4f04b578 100644 --- a/doc/build-windows-msvc.md +++ b/doc/build-windows-msvc.md @@ -59,6 +59,17 @@ ctest --test-dir build --build-config Release # Use "-j N" for N parallel tests cmake --install build --config Release # Optional. ``` +If building with `BUILD_GUI=ON`, vcpkg installation during the build +configuration step might fail because of extremely long paths required during +vcpkg installation if your vcpkg instance is installed in the default Visual +Studio directory. This can be avoided without modifying your vcpkg root +directory by changing vcpkg's intermediate build directory with the +`--x-buildtrees-root` argument to something shorter, for example: + +```powershell +cmake -B build --preset vs2022-static -DVCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:\vcpkg" +``` + ### 5. Building with Dynamic Linking without GUI ```