Skip to content

Commit 820dc65

Browse files
committed
Don't set install-root if passed to function.
1 parent 972e1c4 commit 820dc65

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

toolbox/+vcpkg/buildVcpkgDeps.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,17 @@ function buildVcpkgDeps(manifestFolder, vpckgArguments, options)
8484
% Add vcpkg to path
8585
addToSystemPath(getenv('VCPKG_ROOT'));
8686

87+
% Explicitly use manifest folder to avoid issues with spaces in MATLAB Add-Ons installation folder
88+
if ~contains(vpckgArguments,'--x-install-root')
89+
installRoot = [' --x-install-root ', fullfile(manifestFolder,'vcpkg_installed')];
90+
else
91+
installRoot = '';
92+
end
93+
8794
% Build up vcpkg full command
8895
vcpkgCmd = ['cd ', manifestFolder, ' ',...
8996
targetEnvRootBat,...
90-
' && vcpkg install ', targetTriplet, ' --host-triplet ', vcpkg.getHostTriplet,...
91-
' --x-install-root ', fullfile(manifestFolder,'vcpkg_installed'),... % Explicitly using manifest folder to avoid issues with spaces in MATLAB Add-Ons installation folder
97+
' && vcpkg install ', targetTriplet, ' --host-triplet ', vcpkg.getHostTriplet, installRoot,...
9298
' --overlay-triplets "', fullfile(vcpkg.getToolboxRoot,'overlay-triplets'), '" ', strjoin(vpckgArguments,' ')];
9399

94100
if hasMSVC

0 commit comments

Comments
 (0)