diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-07-08 18:18:42 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-04-02 21:14:02 (GMT) |
commit | 81ad69e056d6c6dd2360e3345f6d99f268ee9e54 (patch) | |
tree | 3787019041ef423a2d62be2ca7a85599ee193712 /Source | |
parent | 6e636f2ebaf78141f4d0a36c96804b9a1bc89857 (diff) | |
download | CMake-81ad69e056d6c6dd2360e3345f6d99f268ee9e54.zip CMake-81ad69e056d6c6dd2360e3345f6d99f268ee9e54.tar.gz CMake-81ad69e056d6c6dd2360e3345f6d99f268ee9e54.tar.bz2 |
Make the SOURCES target property writable.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmTarget.cxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 10ecbfa..475bcdb 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1697,6 +1697,25 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) this->Internal->LinkImplementationPropertyEntries.push_back(entry); return; } + if (prop == "SOURCES") + { + if(this->IsImported()) + { + cmOStringStream e; + e << "SOURCES property can't be set on imported targets (\"" + << this->Name << "\")\n"; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); + return; + } + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmGeneratorExpression ge(lfbt); + this->Internal->SourceEntries.clear(); + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value); + this->Internal->SourceEntries.push_back( + new cmTargetInternals::TargetPropertyEntry(cge)); + return; + } this->Properties.SetProperty(prop, value, cmProperty::TARGET); this->MaybeInvalidatePropertyCache(prop); } @@ -1764,6 +1783,25 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, this->Internal->LinkImplementationPropertyEntries.push_back(entry); return; } + if (prop == "SOURCES") + { + if(this->IsImported()) + { + cmOStringStream e; + e << "SOURCES property can't be set on imported targets (\"" + << this->Name << "\")\n"; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); + return; + } + + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value); + this->Internal->SourceEntries.push_back( + new cmTargetInternals::TargetPropertyEntry(cge)); + return; + } this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString); this->MaybeInvalidatePropertyCache(prop); } |