diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index ba4ca41c5b..4af38e20e3 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -403,8 +403,11 @@ endfunction() function(qt_pull_features_into_current_scope) cmake_parse_arguments(arg "PUBLIC_FEATURES;PRIVATE_FEATURES" "" "" ${ARGN}) foreach(target IN ITEMS ${arg_UNPARSED_ARGUMENTS}) + if(NOT "${target}" MATCHES "^Qt::[a-zA-z][a-zA-Z0-9_]*$") + message(FATAL_ERROR "${target} does not match Qt::[a-zA-z][a-zA-Z0-9_]*. INVALID NAME.") + endif() if(NOT TARGET ${target}) - continue() + message(FATAL_ERROR "${target} not found.") endif() get_target_property(target_type "${target}" TYPE)