aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt29
1 files changed, 22 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 547865a9..eb092c7d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,20 +49,35 @@ qt_internal_sort_module_dependencies("${BUILD_SUBMODULES}" BUILD_SUBMODULES
foreach(module IN LISTS BUILD_SUBMODULES)
# Check for unmet dependencies
if(NOT DEFINED BUILD_${module} OR BUILD_${module})
- message(NOTICE "Check dependencies of '${module}'")
+ message(NOTICE "Checking dependencies of '${module}'")
+ get_property(required_deps GLOBAL PROPERTY QT_REQUIRED_DEPS_FOR_${module})
foreach(dep IN LISTS "${qt_module_dependency_map_prefix}${module}")
if (dep STREQUAL "qtbase")
# Always available skip
continue()
endif()
+
+ set(required FALSE)
+ if(dep IN_LIST required_deps)
+ set(required TRUE)
+ endif()
+
+ set(error_reason "")
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dep}/CMakeLists.txt")
- message(FATAL_ERROR "Module '${module}' depends on '${dep}', but ${dep}'s \
- CMakeLists.txt couldn't be found.\nNote: Use '-skip ${module}' to exclude it \
- from build.\n")
+ set(error_reason "${dep}'s CMakeLists.txt couldn't be found")
+ elseif(DEFINED BUILD_${dep} AND NOT BUILD_${dep})
+ set(error_reason "building '${dep}' was explicitly disabled")
endif()
- if(DEFINED BUILD_${dep} AND NOT BUILD_${dep})
- message(FATAL_ERROR "Module '${module}' depends on '${dep}', but '${dep}' \
- will not be built.\nNote: Use '-skip ${module}' to exclude it from build.\n")
+
+ if(NOT error_reason STREQUAL "")
+ if(required)
+ message(FATAL_ERROR "Module '${module}' depends on '${dep}', "
+ "but ${error_reason}.\n"
+ "Note: Use '-skip ${module}' to exclude it from the build.")
+ else()
+ message(NOTICE "Skipping optional dependency '${dep}' of '${module}', "
+ "because ${error_reason}.")
+ endif()
endif()
endforeach()
endif()