forked from qt-creator/qt-creator
Vcpkg: Prefer environment variable over executable path
The executable can be in a different directory. Change-Id: Ie630d464734d1ef9d0a9e1adfb8da8e56c67b5dd Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -35,10 +35,12 @@ VcpkgSettings::VcpkgSettings()
|
|||||||
|
|
||||||
vcpkgRoot.setSettingsKey("VcpkgRoot");
|
vcpkgRoot.setSettingsKey("VcpkgRoot");
|
||||||
vcpkgRoot.setExpectedKind(PathChooser::ExistingDirectory);
|
vcpkgRoot.setExpectedKind(PathChooser::ExistingDirectory);
|
||||||
FilePath defaultPath = Environment::systemEnvironment().searchInPath(Constants::VCPKG_COMMAND)
|
FilePath defaultPath = FilePath::fromUserInput(
|
||||||
.parentDir();
|
qtcEnvironmentVariable(Constants::ENVVAR_VCPKG_ROOT));
|
||||||
|
|
||||||
if (!defaultPath.isDir())
|
if (!defaultPath.isDir())
|
||||||
defaultPath = FilePath::fromUserInput(qtcEnvironmentVariable(Constants::ENVVAR_VCPKG_ROOT));
|
defaultPath = Environment::systemEnvironment().searchInPath(Constants::VCPKG_COMMAND).parentDir();
|
||||||
|
|
||||||
if (defaultPath.isDir())
|
if (defaultPath.isDir())
|
||||||
vcpkgRoot.setDefaultPathValue(defaultPath);
|
vcpkgRoot.setDefaultPathValue(defaultPath);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user