From 61c472a287305490bef2047784d7670d8354cbf3 Mon Sep 17 00:00:00 2001 From: Gilles Khouzam Date: Wed, 30 Sep 2015 13:22:43 -0700 Subject: cmSystemTools: Add VersionCompareGreater helper Wrap a call to VersionCompare with OP_GREATER in a signature suitable for use with std::sort. --- Source/cmSystemTools.cxx | 8 ++++++++ Source/cmSystemTools.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index d3c1f16..2c5aa8a 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2777,6 +2777,14 @@ bool cmSystemTools::VersionCompare(cmSystemTools::CompareOp op, } //---------------------------------------------------------------------------- +bool cmSystemTools::VersionCompareGreater(std::string const& lhs, + std::string const& rhs) +{ + return cmSystemTools::VersionCompare( + cmSystemTools::OP_GREATER, lhs.c_str(), rhs.c_str()); +} + +//---------------------------------------------------------------------------- bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg, bool* removed) { diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index e88170a..b6b0978 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -294,6 +294,8 @@ public: * Compare versions */ static bool VersionCompare(CompareOp op, const char* lhs, const char* rhs); + static bool VersionCompareGreater(std::string const& lhs, + std::string const& rhs); /** * Determine the file type based on the extension -- cgit v0.12