diff options
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 04ae5af..aea6446 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -551,15 +551,16 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files) const si != this->Internal->SourceEntries.end(); ++si) { std::vector<std::string> srcs; - cmSystemTools::ExpandListArgument((*si)->ge->GetInput(), srcs); + cmSystemTools::ExpandListArgument((*si)->ge->Evaluate(this->Makefile, + "", + false, + this), + srcs); + for(std::vector<std::string>::const_iterator i = srcs.begin(); i != srcs.end(); ++i) { std::string src = *i; - if (cmGeneratorExpression::Find(src) != std::string::npos) - { - continue; - } cmSourceFile* sf = this->Makefile->GetOrCreateSource(src); std::string e; src = sf->GetFullPath(&e); @@ -606,7 +607,14 @@ void cmTarget::AddSources(std::vector<std::string> const& srcs) const char* src = i->c_str(); if(src[0] == '$' && src[1] == '<') { - this->ProcessSourceExpression(*i); + this->AddSource(src); + + if(cmHasLiteralPrefix(i->c_str(), "$<TARGET_OBJECTS:") && + (*i)[i->size()-1] == '>') + { + std::string objLibName = i->substr(17, i->size()-18); + this->ObjectLibraries.push_back(objLibName); + } } else { @@ -734,28 +742,11 @@ cmSourceFile* cmTarget::AddSource(const std::string& src) this->Internal->SourceEntries.push_back( new cmTargetInternals::TargetPropertyEntry(cge)); } - return this->Makefile->GetOrCreateSource(src); -} - - - -//---------------------------------------------------------------------------- -void cmTarget::ProcessSourceExpression(std::string const& expr) -{ - if(cmHasLiteralPrefix(expr.c_str(), "$<TARGET_OBJECTS:") && - expr[expr.size()-1] == '>') + if (cmGeneratorExpression::Find(src) != std::string::npos) { - std::string objLibName = expr.substr(17, expr.size()-18); - this->ObjectLibraries.push_back(objLibName); - this->AddSource(expr); - } - else - { - cmOStringStream e; - e << "Unrecognized generator expression:\n" - << " " << expr; - this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); + return 0; } + return this->Makefile->GetOrCreateSource(src); } //---------------------------------------------------------------------------- @@ -2886,6 +2877,14 @@ const char *cmTarget::GetProperty(const std::string& prop, { std::string objLibName = li->substr(17, li->size()-18); + if (cmGeneratorExpression::Find(objLibName) != std::string::npos) + { + ss << sep; + sep = ";"; + ss << *li; + continue; + } + bool addContent = false; bool noMessage = true; cmOStringStream e; @@ -2920,6 +2919,12 @@ const char *cmTarget::GetProperty(const std::string& prop, ss << *li; } } + else if (cmGeneratorExpression::Find(*li) == std::string::npos) + { + ss << sep; + sep = ";"; + ss << *li; + } else { cmSourceFile *sf = this->Makefile->GetOrCreateSource(*li); |