summaryrefslogtreecommitdiffstats
path: root/Source/cmCMakePathCommand.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-01-13 14:27:49 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2021-01-13 14:27:49 (GMT)
commit76f0bcdfb6e04f1f6089ea693d69b642bbf26e82 (patch)
tree08ee286265df549fac25cee13c2c590135ecfd8c /Source/cmCMakePathCommand.cxx
parent3ad1ee81445d4ce4388bcde7222a676725aebcd6 (diff)
downloadCMake-76f0bcdfb6e04f1f6089ea693d69b642bbf26e82.zip
CMake-76f0bcdfb6e04f1f6089ea693d69b642bbf26e82.tar.gz
CMake-76f0bcdfb6e04f1f6089ea693d69b642bbf26e82.tar.bz2
cmake_path: various updates
To follow discussions in #21385 and !5682: * Fix bug in cmCMakePath::IsSuffix() method * cmake_path(HASH) always normalized paths (NORMALIZE option removed)
Diffstat (limited to 'Source/cmCMakePathCommand.cxx')
-rw-r--r--Source/cmCMakePathCommand.cxx18
1 files changed, 4 insertions, 14 deletions
diff --git a/Source/cmCMakePathCommand.cxx b/Source/cmCMakePathCommand.cxx
index e9bf84a..5662a2f 100644
--- a/Source/cmCMakePathCommand.cxx
+++ b/Source/cmCMakePathCommand.cxx
@@ -929,17 +929,8 @@ bool HandleIsPrefixCommand(std::vector<std::string> const& args,
bool HandleHashCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
- if (args.size() < 3 || args.size() > 4) {
- status.SetError("HASH must be called with two or three arguments.");
- return false;
- }
-
- static NormalizeParser const parser;
-
- const auto arguments = parser.Parse(args);
-
- if (parser.GetInputs().size() != 1) {
- status.SetError("HASH called with unexpected arguments.");
+ if (args.size() != 3) {
+ status.SetError("HASH must be called with two arguments.");
return false;
}
@@ -948,15 +939,14 @@ bool HandleHashCommand(std::vector<std::string> const& args,
return false;
}
- const auto& output = parser.GetInputs().front();
+ const auto& output = args[2];
if (output.empty()) {
status.SetError("Invalid name for output variable.");
return false;
}
- auto hash = hash_value(arguments.Normalize ? cmCMakePath(inputPath).Normal()
- : cmCMakePath(inputPath));
+ auto hash = hash_value(cmCMakePath(inputPath).Normal());
std::ostringstream out;
out << std::setbase(16) << hash;