summaryrefslogtreecommitdiffstats
path: root/Source/cmOptionCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-09-19 15:10:14 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-09-19 15:10:40 (GMT)
commite199294673665e01b1cba48625ec1b18c960c90e (patch)
tree894a3175ec80b810c4b6c2de44e0c8dc26985d3d /Source/cmOptionCommand.cxx
parentcca5897318d5c747078f79cd5bb45ba74955102a (diff)
parent9dba84cfa5e85e51ee6d6799f03a26656063ef8b (diff)
downloadCMake-e199294673665e01b1cba48625ec1b18c960c90e.zip
CMake-e199294673665e01b1cba48625ec1b18c960c90e.tar.gz
CMake-e199294673665e01b1cba48625ec1b18c960c90e.tar.bz2
Merge topic 'refactor-string-concat'
9dba84cfa5 Refactor: Use cmStrCat to construct error strings Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3734
Diffstat (limited to 'Source/cmOptionCommand.cxx')
-rw-r--r--Source/cmOptionCommand.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx
index a0a0989..22e59ac 100644
--- a/Source/cmOptionCommand.cxx
+++ b/Source/cmOptionCommand.cxx
@@ -2,8 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmOptionCommand.h"
-#include <sstream>
-
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
@@ -74,13 +72,13 @@ bool cmOptionCommand(std::vector<std::string> const& args,
const auto* existsAfterSet =
status.GetMakefile().GetStateSnapshot().GetDefinition(args[0]);
if (!existsAfterSet) {
- std::ostringstream w;
- w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0077)
- << "\n"
- "For compatibility with older versions of CMake, option "
- "is clearing the normal variable '"
- << args[0] << "'.";
- status.GetMakefile().IssueMessage(MessageType::AUTHOR_WARNING, w.str());
+ status.GetMakefile().IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0077),
+ "\n"
+ "For compatibility with older versions of CMake, option "
+ "is clearing the normal variable '",
+ args[0], "'."));
}
}
return true;