diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-11-05 15:50:57 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-11-10 16:53:31 +0100 |
commit | 30a9b045cc6421b19898b070ed2cebaf734df174 (patch) | |
tree | 9afe236152d680d83450b6e3ee7b7be92d3ba0ff /cmake/QtProcessConfigureArgs.cmake | |
parent | a3b9e3459f02d23c66b2a7fa5e2ea6fac03bbe82 (diff) |
CMake: Implement configure -list-features
Extend qt_configure_get_padded_string to make the feature list look like
qmake's.
Fixes: QTBUG-88144
Change-Id: I714f2b2f3537b506365a03b5b6bc3413e9cab167
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtProcessConfigureArgs.cmake')
-rw-r--r-- | cmake/QtProcessConfigureArgs.cmake | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index ea3fa1281a..cb92c0fbca 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -9,6 +9,7 @@ # TOP_LEVEL: TRUE, if this is a top-level build. include(${CMAKE_CURRENT_LIST_DIR}/QtFeatureCommon.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/QtBuildInformation.cmake) cmake_policy(SET CMP0007 NEW) cmake_policy(SET CMP0057 NEW) @@ -60,6 +61,8 @@ while(configure_args) set(auto_detect_generator FALSE) elseif(arg STREQUAL "-no-guess-compiler") set(auto_detect_compiler FALSE) + elseif(arg STREQUAL "-list-features") + set(list_features TRUE) elseif(arg STREQUAL "-skip") list(POP_FRONT configure_args qtrepo) push("-DBUILD_${qtrepo}=OFF") @@ -94,7 +97,10 @@ endwhile() set_property(GLOBAL PROPERTY COMMANDLINE_KNOWN_FEATURES "") function(qt_feature feature) + cmake_parse_arguments(arg "" "PURPOSE;SECTION;" "" ${ARGN}) set_property(GLOBAL APPEND PROPERTY COMMANDLINE_KNOWN_FEATURES "${feature}") + set_property(GLOBAL PROPERTY COMMANDLINE_FEATURE_PURPOSE_${feature} "${arg_PURPOSE}") + set_property(GLOBAL PROPERTY COMMANDLINE_FEATURE_SECTION_${feature} "${arg_SECTION}") endfunction() macro(defstub name) @@ -405,6 +411,26 @@ function(qt_call_function func) endif() endfunction() +if(list_features) + unset(lines) + foreach(feature ${commandline_known_features}) + get_property(section GLOBAL PROPERTY COMMANDLINE_FEATURE_SECTION_${feature}) + get_property(purpose GLOBAL PROPERTY COMMANDLINE_FEATURE_PURPOSE_${feature}) + if(purpose) + if(NOT "${section}" STREQUAL "") + string(APPEND section ": ") + endif() + qt_configure_get_padded_string("${feature}" "${section}${purpose}" line + PADDING_LENGTH 25 MIN_PADDING 1) + list(APPEND lines "${line}") + endif() + endforeach() + list(SORT lines) + list(JOIN lines "\n" lines) + message("${lines}") + return() +endif() + while(1) qtConfHasNextCommandlineArg(has_next) if(NOT has_next) |