summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <[email protected]>2024-12-30 10:41:53 +0100
committerJoerg Bornemann <[email protected]>2025-01-02 11:25:11 +0100
commitfecae6ab1b1aa36f43b5cd87b229de4df37e44ab (patch)
tree642dc1d8fcaeea3031aef5b5a8838ab9a8b16c90
parent19564e033cf65a0a67680285d1cbcc85c9437aaf (diff)
CMake: Yield error if VCPKG_ROOT variable is missing
...and vcpkg usage was requested. The user got no further feedback why vcpkg wasn't used despite passing the -vcpkg configure argument. Pick-to: 6.8 6.9 Change-Id: Ib43c2045f093c3887a63406e37f37bdd681341cd Reviewed-by: Alexey Edelev <[email protected]>
-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)