Cleanups: Use cmHas{Prefix,Suffix} instead of String{Starts,Ends}With

This commit is contained in:
Sebastian Holtermann
2019-08-01 12:57:18 +02:00
parent 33d9a69130
commit a693e875db
14 changed files with 29 additions and 22 deletions
+2 -1
View File
@@ -9,6 +9,7 @@
#include "cmMakefile.h"
#include "cmSourceGroup.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
namespace {
@@ -54,7 +55,7 @@ bool rootIsPrefix(const std::string& root,
const std::vector<std::string>& files, std::string& error)
{
for (std::string const& file : files) {
if (!cmSystemTools::StringStartsWith(file, root.c_str())) {
if (!cmHasPrefix(file, root)) {
error = "ROOT: " + root + " is not a prefix of file: " + file;
return false;
}