mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
cmake_language: Remove extraneous MESSAGE_PREFIX param
This commit is contained in:
@@ -389,7 +389,6 @@ struct PrintTargetsArgs : public ArgumentParser::ParseResult
|
||||
bool ImportedOnly = false;
|
||||
bool NoImported = false;
|
||||
bool IgnoreCase = false;
|
||||
cm::optional<std::string> MessagePrefix;
|
||||
};
|
||||
|
||||
// Lists every target that currently exists, optionally filtered by a
|
||||
@@ -414,8 +413,7 @@ bool cmCMakeLanguageCommandPRINT_TARGETS(
|
||||
.Bind("REGEX"_s, &PrintTargetsArgs::Regex)
|
||||
.Bind("IMPORTED_ONLY"_s, &PrintTargetsArgs::ImportedOnly)
|
||||
.Bind("NO_IMPORTED"_s, &PrintTargetsArgs::NoImported)
|
||||
.Bind("IGNORE_CASE"_s, &PrintTargetsArgs::IgnoreCase)
|
||||
.Bind("__MESSAGE_PREFIX"_s, &PrintTargetsArgs::MessagePrefix);
|
||||
.Bind("IGNORE_CASE"_s, &PrintTargetsArgs::IgnoreCase);
|
||||
|
||||
std::vector<std::string> unparsed;
|
||||
auto parsedArgs = ArgsParser.Parse(body, &unparsed);
|
||||
@@ -502,11 +500,8 @@ bool cmCMakeLanguageCommandPRINT_TARGETS(
|
||||
}
|
||||
|
||||
if (anyMatched) {
|
||||
// The message opens with a banner line. The internal __MESSAGE_PREFIX
|
||||
// keyword overrides it (used by wrappers to reproduce legacy output); it
|
||||
// is not part of the public interface.
|
||||
std::string const messagePrefix =
|
||||
parsedArgs.MessagePrefix.value_or("Printing targets...\n");
|
||||
// The message opens with a banner line.
|
||||
std::string out = "Printing targets...\n";
|
||||
// The header reflects the imported-filter mode and any REGEX in effect.
|
||||
char const* label = "All targets";
|
||||
if (parsedArgs.ImportedOnly) {
|
||||
@@ -514,7 +509,7 @@ bool cmCMakeLanguageCommandPRINT_TARGETS(
|
||||
} else if (parsedArgs.NoImported) {
|
||||
label = "Non-imported targets";
|
||||
}
|
||||
std::string out = cmStrCat(messagePrefix, " ", label);
|
||||
out += cmStrCat(" ", label);
|
||||
if (parsedArgs.Regex) {
|
||||
out += cmStrCat(
|
||||
" matching REGEX '", *parsedArgs.Regex, "' (",
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
.*--.*
|
||||
.*-- Printing targets\.\.\.
|
||||
+All targets matching REGEX '\^zz_print_targets_' \(case sensitive\):
|
||||
+zz_print_targets_iface \(INTERFACE_LIBRARY\)
|
||||
+zz_print_targets_imp \(STATIC_LIBRARY, IMPORTED\)
|
||||
+zz_print_targets_lib \(STATIC_LIBRARY\)
|
||||
+zz_print_targets_util \(UTILITY\)
|
||||
.*--.*
|
||||
.*-- Printing targets\.\.\.
|
||||
+Non-imported targets matching REGEX '\^zz_print_targets_' \(case sensitive\):
|
||||
+zz_print_targets_iface \(INTERFACE_LIBRARY\)
|
||||
+zz_print_targets_lib \(STATIC_LIBRARY\)
|
||||
+zz_print_targets_util \(UTILITY\)
|
||||
.*--.*
|
||||
.*-- Printing targets\.\.\.
|
||||
+Imported targets matching REGEX '\^zz_print_targets_' \(case sensitive\):
|
||||
+zz_print_targets_imp \(STATIC_LIBRARY, IMPORTED\)
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
-- Printing targets\.\.\.
|
||||
All targets matching REGEX '\^zz_mp_' \(case sensitive\):
|
||||
zz_mp_lib \(INTERFACE_LIBRARY\)
|
||||
|
||||
-- CUSTOM_BANNER
|
||||
All targets matching REGEX '\^zz_mp_' \(case sensitive\):
|
||||
zz_mp_lib \(INTERFACE_LIBRARY\)
|
||||
@@ -1,7 +0,0 @@
|
||||
add_library(zz_mp_lib INTERFACE)
|
||||
|
||||
# Default banner opens the message.
|
||||
cmake_language(PRINT_TARGETS REGEX "^zz_mp_")
|
||||
|
||||
# The internal __MESSAGE_PREFIX keyword overrides the default banner.
|
||||
cmake_language(PRINT_TARGETS REGEX "^zz_mp_" __MESSAGE_PREFIX "CUSTOM_BANNER\n")
|
||||
@@ -226,7 +226,6 @@ endblock()
|
||||
|
||||
# cmake_language(PRINT_TARGETS)
|
||||
run_cmake(PrintTargets)
|
||||
run_cmake(PrintTargetsMessagePrefix)
|
||||
run_cmake(PrintTargetsMutuallyExclusive)
|
||||
block()
|
||||
set(RunCMake_TEST_NOT_EXPECT_stdout "zz_alias")
|
||||
|
||||
Reference in New Issue
Block a user