From 2e89c61f58db1ce54411ccd9584dd1a3e0a02688 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 6 Apr 2020 11:38:26 +0200 Subject: CMake: Write QT_BUILD_PARTS to qmodule.pri Change-Id: I4bddba38b51df3c70780d94f64a31b3040cb0bc8 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 22 ++++++++++++++++++++++ cmake/QtBuildInformation.cmake | 15 +-------------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 8094219af0..389fb362b8 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -759,6 +759,24 @@ QT_PATCH_VERSION = ${PROJECT_VERSION_PATCH} qt_install(FILES "${qconfig_pri_target_path}" DESTINATION ${INSTALL_MKSPECSDIR}) endfunction() +function(qt_get_build_parts out_var) + set(parts "libs") + + if(BUILD_EXAMPLES AND NOT QT_NO_MAKE_EXAMPLES) + list(APPEND parts "examples") + endif() + + if(BUILD_TESTING AND NOT QT_NO_MAKE_TESTS) + list(APPEND parts "tests") + endif() + + if(NOT CMAKE_CROSSCOMPILING) + list(APPEND parts "tools") + endif() + + set(${out_var} ${parts} PARENT_SCOPE) +endfunction() + # Creates mkspecs/qmodule.pri which contains private global features among other things. function(qt_generate_global_module_pri_file) qt_path_join(qmodule_pri_target_path ${PROJECT_BINARY_DIR} mkspecs) @@ -788,6 +806,10 @@ CONFIG += ${private_config_joined} # TODO: Write QT_COORD_TYPE once we support setting it. + qt_get_build_parts(build_parts) + string(REPLACE ";" " " build_parts "${build_parts}") + string(APPEND content "QT_BUILD_PARTS = ${build_parts}\n") + file(GENERATE OUTPUT "${qmodule_pri_target_path}" CONTENT "${content}" diff --git a/cmake/QtBuildInformation.cmake b/cmake/QtBuildInformation.cmake index 8a210a1b08..08d49aeba8 100644 --- a/cmake/QtBuildInformation.cmake +++ b/cmake/QtBuildInformation.cmake @@ -292,20 +292,7 @@ function(qt_configure_add_summary_build_parts) endfunction() function(qt_configure_process_add_summary_build_parts label) - set(parts "libs") - - if(BUILD_EXAMPLES AND NOT QT_NO_MAKE_EXAMPLES) - list(APPEND parts "examples") - endif() - - if(BUILD_TESTING AND NOT QT_NO_MAKE_TESTS) - list(APPEND parts "tests") - endif() - - if(NOT CMAKE_CROSSCOMPILING) - list(APPEND parts "tools") - endif() - + qt_get_build_parts(parts) string(REPLACE ";" " " message "${parts}") qt_configure_add_report_padded("${label}" "${message}") endfunction() -- cgit v1.2.3