From 39a9eb8e8418d482882dbaca93f30354c7c47896 Mon Sep 17 00:00:00 2001 From: Victor NIVET Date: Mon, 30 Oct 2023 10:43:08 +0100 Subject: [PATCH 1/2] [vcpkg_configure_make] fix case sensitive comparison in PATH system dir search --- scripts/cmake/vcpkg_configure_make.cmake | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index 67a935ee4422bb..098cc8f3c29a6b 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -235,22 +235,15 @@ function(vcpkg_configure_make) cmake_path(CONVERT "$ENV{PATH}" TO_CMAKE_PATH_LIST path_list NORMALIZE) cmake_path(CONVERT "$ENV{SystemRoot}" TO_CMAKE_PATH_LIST system_root NORMALIZE) cmake_path(CONVERT "$ENV{LOCALAPPDATA}" TO_CMAKE_PATH_LIST local_app_data NORMALIZE) + string(TOUPPER "${local_app_data}" local_app_data_upper) file(REAL_PATH "${system_root}" system_root) string(TOUPPER "${system_root}" system_root_upper) message(DEBUG "path_list:${path_list}") # Just to have --trace-expand output vcpkg_list(SET find_system_dirs - "${system_root}/system32" - "${system_root}/System32" - "${system_root}/system32/" - "${system_root}/System32/" - "${system_root_upper}/system32" - "${system_root_upper}/System32" - "${system_root_upper}/system32/" - "${system_root_upper}/System32/" - "${local_app_data}/Microsoft/WindowsApps" - "${local_app_data}/Microsoft/WindowsApps/" + "${system_root_upper}/SYSTEM32" + "${local_app_data_upper}/MICROSOFT/WINDOWSAPPS" ) string(TOUPPER "${find_system_dirs}" find_system_dirs_upper) @@ -258,7 +251,8 @@ function(vcpkg_configure_make) set(index 0) set(appending TRUE) foreach(item IN LISTS path_list) - if(item IN_LIST find_system_dirs OR item IN_LIST find_system_dirs_upper) + string(TOUPPER "${item}" item_upper) + if(item_upper IN_LIST find_system_dirs_upper OR "${item_upper}/" IN_LIST find_system_dirs_upper) set(appending FALSE) break() endif() From 50babd675896c31866ac7c21d5b4667a473ef54e Mon Sep 17 00:00:00 2001 From: Victor NIVET Date: Mon, 30 Oct 2023 12:15:47 +0100 Subject: [PATCH 2/2] Fixes after code review --- scripts/cmake/vcpkg_configure_make.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index 098cc8f3c29a6b..6d6867da0f509c 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -235,15 +235,15 @@ function(vcpkg_configure_make) cmake_path(CONVERT "$ENV{PATH}" TO_CMAKE_PATH_LIST path_list NORMALIZE) cmake_path(CONVERT "$ENV{SystemRoot}" TO_CMAKE_PATH_LIST system_root NORMALIZE) cmake_path(CONVERT "$ENV{LOCALAPPDATA}" TO_CMAKE_PATH_LIST local_app_data NORMALIZE) - string(TOUPPER "${local_app_data}" local_app_data_upper) file(REAL_PATH "${system_root}" system_root) - string(TOUPPER "${system_root}" system_root_upper) message(DEBUG "path_list:${path_list}") # Just to have --trace-expand output vcpkg_list(SET find_system_dirs - "${system_root_upper}/SYSTEM32" - "${local_app_data_upper}/MICROSOFT/WINDOWSAPPS" + "${system_root}/System32" + "${system_root}/System32/" + "${local_app_data}/Microsoft/WindowsApps" + "${local_app_data}/Microsoft/WindowsApps/" ) string(TOUPPER "${find_system_dirs}" find_system_dirs_upper) @@ -252,7 +252,7 @@ function(vcpkg_configure_make) set(appending TRUE) foreach(item IN LISTS path_list) string(TOUPPER "${item}" item_upper) - if(item_upper IN_LIST find_system_dirs_upper OR "${item_upper}/" IN_LIST find_system_dirs_upper) + if(item_upper IN_LIST find_system_dirs_upper) set(appending FALSE) break() endif()