diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-03-02 18:06:46 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-03-09 23:08:57 +0100 |
commit | 95e1469eb8be6c7dd98d2bdb3bae4800e75cd2b7 (patch) | |
tree | 529862d03edce64c2f76e78cf608ea4795467ebf /cmake/QtFeature.cmake | |
parent | a64f4b405222527a72fb087226801c52ddf54ef0 (diff) |
CMake: Port most of the configure summary support
Teaches configurejson2cmake about summaries / reports, so things
like enabled features, configure sections, notes, etc.
Add relevant CMake API for adding summary sections and entries,
as well as configure reports. The commands record the passed data,
and the data is later evaluated when the summary needs to be printed.
This is needed, to ensure that all features are evaluated by the
time the summary is printed.
Some report and summary entries are not generated if they mention a
feature that is explicitly exclduded by configurejson2cmake's feature
mapping dictionary. This is to prevent CMake from failing at configure
time when trying to evaluate an unknown feature. We should re-enable
these in the future.
A few custom report types are skipped by configurejson2cmake (like
values of qmake CONFIG or buildParts).
These will have to be addressed a case-by-case basis if still needed.
Change-Id: I95d74ce34734d347681905f15a781f64b5bd5edc
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtFeature.cmake')
-rw-r--r-- | cmake/QtFeature.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 7b852b3c2e..34ae83b55d 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -14,6 +14,9 @@ function(qt_feature_module_begin) if ("${arg_PRIVATE_FILE}" STREQUAL "") message(FATAL_ERROR "qt_feature_begin_module needs a PRIVATE_FILE name!") endif() + set(__QtFeature_only_evaluate_features OFF PARENT_SCOPE) + else() + set(__QtFeature_only_evaluate_features ON PARENT_SCOPE) endif() set(__QtFeature_library "${arg_LIBRARY}" PARENT_SCOPE) @@ -278,6 +281,9 @@ function(qt_evaluate_feature feature) qt_feature_set_cache_value(cache "${feature}" "${emit_if}" "${result}" "${arg_LABEL}") qt_feature_set_value("${feature}" "${cache}" "${emit_if}" "${condition}" "${arg_LABEL}") + + # Store each feature's label for summary info. + set(QT_FEATURE_LABEL_${feature} "${arg_LABEL}" CACHE INTERNAL "") endfunction() function(qt_feature_config feature config_var_name) @@ -581,6 +587,7 @@ function(qt_feature_module_end) unset(__QtFeature_define_definitions PARENT_SCOPE) unset(__QtFeature_custom_enabled_features PARENT_SCOPE) unset(__QtFeature_custom_disabled_features PARENT_SCOPE) + unset(__QtFeature_only_evaluate_features PARENT_SCOPE) endfunction() function(qt_feature_copy_global_config_features_to_core target) |