diff --git a/cmake/QtAutoDetect.cmake b/cmake/QtAutoDetect.cmake index 5652124d915..cbfd5826db4 100644 --- a/cmake/QtAutoDetect.cmake +++ b/cmake/QtAutoDetect.cmake @@ -171,7 +171,7 @@ function(qt_auto_detect_vcpkg) if(DEFINED CMAKE_TOOLCHAIN_FILE) get_filename_component(supplied_toolchain_file "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE) if(NOT supplied_toolchain_file STREQUAL vcpkg_toolchain_file) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}" CACHE STRING "") + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${supplied_toolchain_file}" CACHE STRING "") endif() unset(supplied_toolchain_file) endif()