summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-06-04 14:21:33 (GMT)
committerBrad King <brad.king@kitware.com>2013-07-24 15:52:44 (GMT)
commitb655865bbf85e0bb9587dea099c5996836f48cb8 (patch)
treef8f7e299fc5eced4a6f100e1067622bb8f52d767 /Source/cmTarget.cxx
parent828ddb68139a080594c2e6a96d57cb9e93d2ccb3 (diff)
downloadCMake-b655865bbf85e0bb9587dea099c5996836f48cb8.zip
CMake-b655865bbf85e0bb9587dea099c5996836f48cb8.tar.gz
CMake-b655865bbf85e0bb9587dea099c5996836f48cb8.tar.bz2
target_link_libraries: Add PUBLIC/PRIVATE/INTERFACE keyword signature
Add a new signature to help populate INTERFACE_LINK_LIBRARIES and LINK_LIBRARIES cleanly in a single call. Add policy CMP0023 to control whether the keyword signatures can be mixed with uses of the plain signatures on the same target.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx51
1 files changed, 51 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 26bf9b7..0b3b785 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2494,6 +2494,57 @@ static std::string targetNameGenex(const char *lib)
}
//----------------------------------------------------------------------------
+bool cmTarget::PushTLLCommandTrace(TLLSignature signature)
+{
+ bool ret = true;
+ if (!this->TLLCommands.empty())
+ {
+ if (this->TLLCommands.back().first != signature)
+ {
+ ret = false;
+ }
+ }
+ cmListFileBacktrace lfbt;
+ this->Makefile->GetBacktrace(lfbt);
+ this->TLLCommands.push_back(std::make_pair(signature, lfbt));
+ return ret;
+}
+
+//----------------------------------------------------------------------------
+void cmTarget::GetTllSignatureTraces(cmOStringStream &s,
+ TLLSignature sig) const
+{
+ std::vector<cmListFileBacktrace> sigs;
+ typedef std::vector<std::pair<TLLSignature, cmListFileBacktrace> > Container;
+ for(Container::const_iterator it = this->TLLCommands.begin();
+ it != this->TLLCommands.end(); ++it)
+ {
+ if (it->first == sig)
+ {
+ sigs.push_back(it->second);
+ }
+ }
+ if (!sigs.empty())
+ {
+ const char *sigString
+ = (sig == cmTarget::KeywordTLLSignature ? "keyword"
+ : "plain");
+ s << "The uses of the " << sigString << " signature are here:\n";
+ for(std::vector<cmListFileBacktrace>::const_iterator it = sigs.begin();
+ it != sigs.end(); ++it)
+ {
+ cmListFileBacktrace::const_iterator i = it->begin();
+ if(i != it->end())
+ {
+ cmListFileContext const& lfc = *i;
+ s << " * " << (lfc.Line? "": " in ") << lfc << std::endl;
+ ++i;
+ }
+ }
+ }
+}
+
+//----------------------------------------------------------------------------
void cmTarget::AddLinkLibrary(cmMakefile& mf,
const char *target, const char* lib,
LinkLibraryType llt)