From c2c25d916f049ff15591c50f3aa47345454f0772 Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Thu, 24 Nov 2022 01:04:20 +0100 Subject: [PATCH] [baseline] unset the backup var and not the var which was backed up. (#27984) * unset the backup var and not the var which was backed up. * if no backup unset the vcpkg set var --- scripts/buildsystems/vcpkg.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 652322eba9..0b2507cac1 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -833,8 +833,10 @@ macro("${VCPKG_OVERRIDE_FIND_PACKAGE_NAME}" z_vcpkg_find_package_package_name) foreach(z_vcpkg_find_package_${z_vcpkg_find_package_backup_id}_backup_var IN LISTS z_vcpkg_find_package_${z_vcpkg_find_package_backup_id}_backup_vars) if(DEFINED z_vcpkg_find_package_${z_vcpkg_find_package_backup_id}_backup_${z_vcpkg_find_package_${z_vcpkg_find_package_backup_id}_backup_var}) set("${z_vcpkg_find_package_${z_vcpkg_find_package_backup_id}_backup_var}" "${z_vcpkg_find_package_${z_vcpkg_find_package_backup_id}_backup_${z_vcpkg_find_package_${z_vcpkg_find_package_backup_id}_backup_var}}") + else() + unset("${z_vcpkg_find_package_${z_vcpkg_find_package_backup_id}_backup_var}") endif() - unset("${z_vcpkg_find_package_${z_vcpkg_find_package_backup_id}_backup_var}") + unset("z_vcpkg_find_package_${z_vcpkg_find_package_backup_id}_backup_${z_vcpkg_find_package_${z_vcpkg_find_package_backup_id}_backup_var}") endforeach() math(EXPR z_vcpkg_find_package_backup_id "${z_vcpkg_find_package_backup_id} - 1") if(z_vcpkg_find_package_backup_id LESS "0")