diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-01-10 13:47:25 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-01-17 08:33:50 +0000 |
commit | 235769d56b38647b196d0d61099aae3c6dcc023f (patch) | |
tree | 0bba54a942a0bcacc6f5a3014385d3d89421c1ce /cmake | |
parent | 4f26758978e84f959a28d90b2ff336bae32a2d3f (diff) |
CMake: Error out on mis-use of qt_pull_features_into_current_scope
Make it a bit harder to mis-use qt_pull_features_into_current_scope.
Change-Id: I2a6be28d7c0e6207217cb1908ec22cc757acd01a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtFeature.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
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) |