summaryrefslogtreecommitdiffstats
path: root/cmake/QtAutoDetectHelpers.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/QtAutoDetectHelpers.cmake')
-rw-r--r--cmake/QtAutoDetectHelpers.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmake/QtAutoDetectHelpers.cmake b/cmake/QtAutoDetectHelpers.cmake
index a3fe523f96b..bffcfb9de46 100644
--- a/cmake/QtAutoDetectHelpers.cmake
+++ b/cmake/QtAutoDetectHelpers.cmake
@@ -152,7 +152,12 @@ function(qt_auto_detect_android)
endfunction()
function(qt_auto_detect_vcpkg)
- if(QT_USE_VCPKG AND DEFINED ENV{VCPKG_ROOT})
+ if(QT_USE_VCPKG)
+ if(NOT DEFINED ENV{VCPKG_ROOT})
+ message(FATAL_ERROR
+ "Usage of vcpkg was requested but the environment variable VCPKG_ROOT is not set."
+ )
+ endif()
set(vcpkg_toolchain_file "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
get_filename_component(vcpkg_toolchain_file "${vcpkg_toolchain_file}" ABSOLUTE)