From 4da3cae9ffb3202d9c447e9f497f8a2758538b06 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Fri, 20 Jan 2017 18:59:17 +0100 Subject: FeatureSummary: Clean printed output * Remove space before commas * Do not add an empty line before the first type of packages Also fix a typo in unit test. --- Modules/FeatureSummary.cmake | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Modules/FeatureSummary.cmake') diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index 78d9df3dd1..93da02143e 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -14,12 +14,12 @@ packages and/or feature for a build tree such as:: LibXml2 (required version >= 2.4), XML processing lib, * Enables HTML-import in MyWordProcessor * Enables odt-export in MyWordProcessor - PNG , A PNG image library. , + PNG, A PNG image library., * Enables saving screenshots -- The following OPTIONAL packages have not been found: - Lua51 , The Lua scripting language. , + Lua51, The Lua scripting language., * Enables macros in MyWordProcessor - Foo , Foo provides cool stuff. + Foo, Foo provides cool stuff. Functions ^^^^^^^^^ @@ -87,11 +87,11 @@ function(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet) endif() get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION) if(_info) - string(APPEND _currentFeatureText " , ${_info}") + string(APPEND _currentFeatureText ", ${_info}") endif() get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL) if(_info) - string(APPEND _currentFeatureText " , <${_info}>") + string(APPEND _currentFeatureText ", <${_info}>") endif() get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE) @@ -287,7 +287,10 @@ function(FEATURE_SUMMARY) set(_tmp) _FS_GET_FEATURE_SUMMARY( ${part} _tmp ${_FS_INCLUDE_QUIET_PACKAGES}) if(_tmp) - string(APPEND _fullText "\n-- ${title_${part}}\n${_tmp}\n") + if(_fullText) + string(APPEND _fullText "\n-- ") + endif() + string(APPEND _fullText "${title_${part}}\n${_tmp}\n") if("${part}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND") set(requiredPackagesNotFound TRUE) endif() -- cgit v1.2.1