cmSystemTools: Add VersionCompareEqual helper

Wrap a call to VersionCompare with OP_EQUAL.
This commit is contained in:
Brad King 2016-01-11 13:42:07 -05:00
parent c173e37fa3
commit ad594de8cc
2 changed files with 10 additions and 0 deletions

View File

@ -2776,6 +2776,14 @@ bool cmSystemTools::VersionCompare(cmSystemTools::CompareOp op,
return op == cmSystemTools::OP_EQUAL;
}
//----------------------------------------------------------------------------
bool cmSystemTools::VersionCompareEqual(std::string const& lhs,
std::string const& rhs)
{
return cmSystemTools::VersionCompare(
cmSystemTools::OP_EQUAL, lhs.c_str(), rhs.c_str());
}
//----------------------------------------------------------------------------
bool cmSystemTools::VersionCompareGreater(std::string const& lhs,
std::string const& rhs)

View File

@ -294,6 +294,8 @@ public:
* Compare versions
*/
static bool VersionCompare(CompareOp op, const char* lhs, const char* rhs);
static bool VersionCompareEqual(std::string const& lhs,
std::string const& rhs);
static bool VersionCompareGreater(std::string const& lhs,
std::string const& rhs);