diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-01-15 10:46:55 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-01-15 10:47:02 (GMT) |
commit | 50b8dc8735e836658755e6dc3dc2a9f00e1006e1 (patch) | |
tree | 73c5e6ffc7b0383e539d034d6e7fca56fc9e21d6 /Source | |
parent | e6b6e457a0e8d33402bc7d64d85b20a8ca0546a0 (diff) | |
parent | 76f0bcdfb6e04f1f6089ea693d69b642bbf26e82 (diff) | |
download | CMake-50b8dc8735e836658755e6dc3dc2a9f00e1006e1.zip CMake-50b8dc8735e836658755e6dc3dc2a9f00e1006e1.tar.gz CMake-50b8dc8735e836658755e6dc3dc2a9f00e1006e1.tar.bz2 |
Merge topic 'cmake_path-stabilization'
76f0bcdfb6 cmake_path: various updates
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5695
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCMakePath.cxx | 3 | ||||
-rw-r--r-- | Source/cmCMakePathCommand.cxx | 18 |
2 files changed, 6 insertions, 15 deletions
diff --git a/Source/cmCMakePath.cxx b/Source/cmCMakePath.cxx index b8215df..73321c6 100644 --- a/Source/cmCMakePath.cxx +++ b/Source/cmCMakePath.cxx @@ -88,7 +88,8 @@ bool cmCMakePath::IsPrefix(const cmCMakePath& path) const ++prefix_it; ++path_it; } - return prefix_it == prefix_end; + return (prefix_it == prefix_end) || + (prefix_it->empty() && path_it != path_end); } std::string cmCMakePath::FormatPath(std::string path, format fmt) 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; |