From a63562f0a877c571c90ba2531fe3fc0329572f8d Mon Sep 17 00:00:00 2001 From: snehara99 <113148726+snehara99@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:14:32 -0400 Subject: [PATCH] if installDir is a relative path, calculate it relative to the source directory (#3903) * if installDir is a relative path, I calculate it relative to the source dir * updated location of checking and updating installDir * combined with expansion check --- CHANGELOG.md | 9 +++++---- src/preset.ts | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b78f6fc..5c3e7cb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,11 +15,12 @@ Bug Fixes: - Fix issue where `cmakeUserPresets.json` not showing up in project outline. [#3832](https://github.com/microsoft/vscode-cmake-tools/issues/3832) - Fix edge case where parsing tests fails when additional output is printed before tests json. [#3750](https://github.com/microsoft/vscode-cmake-tools/issues/3750) - Fix issue where `Configure with CMake Debugger` fails on restart because the previously used pipe to CMake Debugger is no longer available. [#3582](https://github.com/microsoft/vscode-cmake-tools/issues/3582) -- Fix custom kit PATH being overriden [#3849](https://github.com/microsoft/vscode-cmake-tools/issues/3849) -- Fix debug variables being overriden [#3806](https://github.com/microsoft/vscode-cmake-tools/issues/3806) +- Fix custom kit PATH being overriden. [#3849](https://github.com/microsoft/vscode-cmake-tools/issues/3849) +- Fix debug variables being overriden. [#3806](https://github.com/microsoft/vscode-cmake-tools/issues/3806) - Fix issue in Quick Start where a C file was generated in place of a C++ file. [#3856](https://github.com/microsoft/vscode-cmake-tools/issues/3856) -- Fix custom build tasks not showing up [#3622](https://github.com/microsoft/vscode-cmake-tools/issues/3622) -- Fix issue with CMakeLists.txt depth search [#3901](https://github.com/microsoft/vscode-cmake-tools/issues/3901) +- Fix custom build tasks not showing up. [#3622](https://github.com/microsoft/vscode-cmake-tools/issues/3622) +- Fix the bug where if a relative path specified for `installDir`, it is not calculated relative to the source directory, which is how it should be according to the CMake `installDir` docs [here](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#configure-preset). [#3871](https://github.com/microsoft/vscode-cmake-tools/issues/3871) +- Fix issue with CMakeLists.txt depth search. [#3901](https://github.com/microsoft/vscode-cmake-tools/issues/3901) ## 1.18.43 diff --git a/src/preset.ts b/src/preset.ts index 5afe8f74..0c954780 100644 --- a/src/preset.ts +++ b/src/preset.ts @@ -850,7 +850,7 @@ export async function expandConfigurePreset(folder: string, name: string, worksp } if (preset.installDir) { - expandedPreset.installDir = util.lightNormalizePath(await expandString(preset.installDir, expansionOpts)); + expandedPreset.installDir = util.resolvePath(await expandString(preset.installDir, expansionOpts), sourceDir); } if (preset.toolchainFile) {