build: install vcpkg binary packages in dep order

Use the new code in the powershell module for vcpkg binary packages to
install the downloaded binary packages in dependency order with build
dependencies so that the database is not corrupted at any point in the
installation process or after.

Also remove the build binary package directory after installation, so
that all the previous packages are not reinstalled if a package is
updated on a subsequent run.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2023-11-07 15:36:40 +00:00
parent e9162a0d28
commit 1af7aa2333
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 8 additions and 8 deletions

View File

@ -258,14 +258,14 @@ function(get_binary_packages vcpkg_exe)
set(powershell pwsh) set(powershell pwsh)
endif() endif()
foreach(pkg ${to_install}) execute_process(
execute_process( COMMAND ${powershell}
COMMAND ${powershell} -executionpolicy bypass -noprofile
-executionpolicy bypass -noprofile -command "import-module '${CMAKE_BINARY_DIR}/vcpkg-binpkg/vcpkg-binpkg.psm1'; vcpkg-instpkg ."
-command "import-module '${CMAKE_BINARY_DIR}/vcpkg-binpkg/vcpkg-binpkg.psm1'; vcpkg-instpkg './${pkg}'" WORKING_DIRECTORY ${bin_pkgs_dir}
WORKING_DIRECTORY ${bin_pkgs_dir} )
)
endforeach() file(REMOVE_RECURSE ${bin_pkgs_dir})
endif() endif()
set(binary_packages_installed TRUE PARENT_SCOPE) set(binary_packages_installed TRUE PARENT_SCOPE)