Deduplicate the isGeneratorExpression method.

This API seems like the most appropriate.
This commit is contained in:
Stephen Kelly
2013-02-06 13:18:10 +01:00
parent 1714c27a74
commit 92e98dd909
6 changed files with 19 additions and 36 deletions
+1 -9
View File
@@ -264,20 +264,12 @@ static std::string compileProperty(cmTarget *tgt, const std::string &lib,
return tgt->GetDebugGeneratorExpressions(value, llt);
}
//----------------------------------------------------------------------------
static bool isGeneratorExpression(const std::string &lib)
{
const std::string::size_type openpos = lib.find("$<");
return (openpos != std::string::npos)
&& (lib.find(">", openpos) != std::string::npos);
}
//----------------------------------------------------------------------------
void
cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
cmTarget::LinkLibraryType llt)
{
const bool isGenex = isGeneratorExpression(lib);
const bool isGenex = cmGeneratorExpression::Find(lib) != std::string::npos;
cmsys::RegularExpression targetNameValidator;
targetNameValidator.compile("^[A-Za-z0-9_.:-]+$");