From 4f2674dce61fbc06729fb4271cb94561c7702cfc Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Thu, 8 Feb 2024 11:22:29 +0100 Subject: [PATCH] Suggest the correct switch to skip repo when configuring Qt Add -DBUILD_=OFF suggestion for the cases when configuring Qt using CMake and the repo dependecies are missing. Change-Id: Iaa370b49e8fd634bebb7c8300d076165c51dec5e Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bf4a327..ad0b001e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,9 +76,15 @@ foreach(module IN LISTS QT_BUILD_SUBMODULES) if(NOT error_reason STREQUAL "") if(required) + if(QT_INTERNAL_CALLED_FROM_CONFIGURE) + set(skip_argument "-skip ${module}") + else() + set(skip_argument "-DBUILD_${module}=OFF") + endif() + message(FATAL_ERROR "Module '${module}' depends on '${dep}', " "but ${error_reason}.\n" - "Note: Use '-skip ${module}' to exclude it from the build.") + "Note: Use '${skip_argument}' to exclude it from the build.") else() message(STATUS "Skipping optional dependency '${dep}' of '${module}', " "because ${error_reason}.")