diff --git a/scripts/get_cmake_vars/CMakeLists.txt b/scripts/get_cmake_vars/CMakeLists.txt index 6be5947873..2b0bd671a5 100644 --- a/scripts/get_cmake_vars/CMakeLists.txt +++ b/scripts/get_cmake_vars/CMakeLists.txt @@ -79,7 +79,7 @@ foreach(VAR IN LISTS VCPKG_VARS_TO_CHECK) endforeach() foreach(_env IN LISTS VCPKG_ENV_VARS_TO_CHECK) - IF(WIN32) + if(CMAKE_HOST_WIN32) string(REPLACE "\\" "/" ENV_${_env} "$ENV{${_env}}") string(APPEND OUTPUT_STRING "set(${VCPKG_VAR_PREFIX}_ENV_${_env} \"${ENV_${_env}}\")\n") else()