diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-11-28 17:05:08 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-12-07 12:41:43 +0000 |
commit | 9fa13b2c5f43d6fbaeb4360ac54391a91b3e9e54 (patch) | |
tree | 61887ff3f838bf890bbd6d95302e862d829da9a0 /sources | |
parent | 4d82ee992992251bcadf0097a4df60fe7c3b7ef8 (diff) |
Make quiet builds really quiet
The change does a couple of things:
- Sets the distutils / setuptools --verbose option to 0
- Sets the distutils / setuptools --quiet option to 1
- The options above end up calling distutils.log.set_verbosity(0)
- Passes the QUIET_BUILD cmake option from setup.py to every
CMake invocation, when --quiet is passed to setup.py
- Sets the CMAKE_INSTALL_MESSAGE variable to silence messages
regarding installation of files
- Sets the CMAKE_RULE_MESSAGES variable to disable progress report
in makefiles when building each source file
- Overrides the CMake message function, not to display
STATUS / info / untyped messages (still displays warnings and
errors)
- Changes the build / install elapsed time messages to always be
printed even in quiet mode
- Reverts the previously introduced set_quiet function in utils,
because log.set_verbosity() now takes care of silencing those
messages
As a result, there's a lot less clutter when doing a quiet build.
Warnings, errors and shiboken output is still displayed.
Change-Id: Ie05c593ce7dc0aa04554c2d2859ce655233ddb9f
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/pyside2/CMakeLists.txt | 52 | ||||
-rw-r--r-- | sources/shiboken2/CMakeLists.txt | 19 |
2 files changed, 58 insertions, 13 deletions
diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt index 25598bb5e..1d563fb44 100644 --- a/sources/pyside2/CMakeLists.txt +++ b/sources/pyside2/CMakeLists.txt @@ -15,6 +15,25 @@ include(helpers) option(USE_PYTHON_VERSION "Use specific python version to build pyside2." "") +# Don't display "up-to-date / install" messages when installing, to reduce visual clutter. +if (QUIET_BUILD) + set(CMAKE_INSTALL_MESSAGE NEVER) +endif() + +# Override message not to display info messages when doing a quiet build. +if (QUIET_BUILD) + function(message) + list(GET ARGV 0 MessageType) + if (MessageType STREQUAL FATAL_ERROR OR + MessageType STREQUAL SEND_ERROR OR + MessageType STREQUAL WARNING OR + MessageType STREQUAL AUTHOR_WARNING) + list(REMOVE_AT ARGV 0) + _message(${MessageType} "${ARGV}") + endif() + endfunction() +endif() + if (USE_PYTHON_VERSION) find_package(PythonInterp ${USE_PYTHON_VERSION} REQUIRED) find_package(PythonLibs ${USE_PYTHON_VERSION} REQUIRED) @@ -252,7 +271,26 @@ include(PySideModules) macro(COLLECT_MODULE_IF_FOUND shortname) set(name "Qt5${shortname}") - find_package(${name}) + + # Determine essential/optional/missing + set(module_state "missing") + list(FIND ALL_ESSENTIAL_MODULES "${shortname}" essentialIndex) + if(${essentialIndex} EQUAL -1) + list(FIND ALL_OPTIONAL_MODULES "${shortname}" optionalIndex) + if(NOT ${optionalIndex} EQUAL -1) + set(module_state "optional") + endif() + else() + set(module_state "essential") + endif() + + # Silence warnings when optional packages are not found when doing a quiet build. + set(quiet_argument "") + if (QUIET_BUILD AND "${module_state}" STREQUAL "optional") + set(quiet_argument "QUIET") + endif() + + find_package(${name} ${quiet_argument}) # If package is found, _name_found will be equal to 1 set(_name_found "${name}_FOUND") # _name_dir will keep the path to the directory where the CMake rules were found @@ -276,18 +314,6 @@ macro(COLLECT_MODULE_IF_FOUND shortname) get_filename_component(_module_dir "${${_name_dir}}" ABSOLUTE) string(FIND "${_module_dir}" "${_core_abs_dir}" found_basepath) - # Determine essential/optional/missing - set(module_state "missing") - list(FIND ALL_ESSENTIAL_MODULES "${shortname}" essentialIndex) - if(${essentialIndex} EQUAL -1) - list(FIND ALL_OPTIONAL_MODULES "${shortname}" optionalIndex) - if(NOT ${optionalIndex} EQUAL -1) - set(module_state "optional") - endif() - else() - set(module_state "essential") - endif() - # If the module was found, and also the module path is the same as the # Qt5Core base path, we will generate the list with the modules to be installed set(looked_in_message ". Looked in: ${${_name_dir}}") diff --git a/sources/shiboken2/CMakeLists.txt b/sources/shiboken2/CMakeLists.txt index 12a9b8773..619c0f08c 100644 --- a/sources/shiboken2/CMakeLists.txt +++ b/sources/shiboken2/CMakeLists.txt @@ -16,6 +16,25 @@ add_definitions(${Qt5Core_DEFINITIONS}) option(BUILD_TESTS "Build tests." TRUE) option(USE_PYTHON_VERSION "Use specific python version to build shiboken2." "") +# Don't display "up-to-date / install" messages when installing, to reduce visual clutter. +if (QUIET_BUILD) + set(CMAKE_INSTALL_MESSAGE NEVER) +endif() + +# Override message not to display info messages when doing a quiet build. +if (QUIET_BUILD) + function(message) + list(GET ARGV 0 MessageType) + if (MessageType STREQUAL FATAL_ERROR OR + MessageType STREQUAL SEND_ERROR OR + MessageType STREQUAL WARNING OR + MessageType STREQUAL AUTHOR_WARNING) + list(REMOVE_AT ARGV 0) + _message(${MessageType} "${ARGV}") + endif() + endfunction() +endif() + if (USE_PYTHON_VERSION) find_package(PythonInterp ${USE_PYTHON_VERSION} REQUIRED) find_package(PythonLibs ${USE_PYTHON_VERSION} REQUIRED) |