summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetLinkLibrariesCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-08-18 14:11:29 (GMT)
committerBrad King <brad.king@kitware.com>2008-08-18 14:11:29 (GMT)
commit94c1fe83fd1ef121f592554df0dedda5416afeba (patch)
tree095fb063b2de24dabfbf1aed1f72a56da94a936e /Source/cmTargetLinkLibrariesCommand.cxx
parent7f7068e9d48666ce58f6ba9455a52e7fadee9d6f (diff)
downloadCMake-94c1fe83fd1ef121f592554df0dedda5416afeba.zip
CMake-94c1fe83fd1ef121f592554df0dedda5416afeba.tar.gz
CMake-94c1fe83fd1ef121f592554df0dedda5416afeba.tar.bz2
ENH: Make link interface mode more distinct
Rename the recently added INTERFACE mode of the target_link_libraries() command to LINK_INTERFACE_LIBRARIES. This makes it much more distinct from a normal call to the command, and clearly states its connection to the property of the same name. Also require the option to appear immediately after the target name to make it a mode rather than an option.
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.cxx')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx25
1 files changed, 16 insertions, 9 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 21acf80..0bccd27 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -64,15 +64,22 @@ bool cmTargetLinkLibrariesCommand
// add libraries, nothe that there is an optional prefix
// of debug and optimized than can be used
- std::vector<std::string>::const_iterator i = args.begin();
-
- for(++i; i != args.end(); ++i)
+ for(unsigned int i=1; i < args.size(); ++i)
{
- if(*i == "INTERFACE")
+ if(args[i] == "LINK_INTERFACE_LIBRARIES")
{
this->DoingInterface = true;
+ if(i != 1)
+ {
+ this->Makefile->IssueMessage(
+ cmake::FATAL_ERROR,
+ "The LINK_INTERFACE_LIBRARIES option must appear as the second "
+ "argument, just after the target name."
+ );
+ return true;
+ }
}
- else if(*i == "debug")
+ else if(args[i] == "debug")
{
if(haveLLT)
{
@@ -81,7 +88,7 @@ bool cmTargetLinkLibrariesCommand
llt = cmTarget::DEBUG;
haveLLT = true;
}
- else if(*i == "optimized")
+ else if(args[i] == "optimized")
{
if(haveLLT)
{
@@ -90,7 +97,7 @@ bool cmTargetLinkLibrariesCommand
llt = cmTarget::OPTIMIZED;
haveLLT = true;
}
- else if(*i == "general")
+ else if(args[i] == "general")
{
if(haveLLT)
{
@@ -103,7 +110,7 @@ bool cmTargetLinkLibrariesCommand
{
// The link type was specified by the previous argument.
haveLLT = false;
- this->HandleLibrary(i->c_str(), llt);
+ this->HandleLibrary(args[i].c_str(), llt);
}
else
{
@@ -129,7 +136,7 @@ bool cmTargetLinkLibrariesCommand
llt = cmTarget::OPTIMIZED;
}
}
- this->HandleLibrary(i->c_str(), llt);
+ this->HandleLibrary(args[i].c_str(), llt);
}
}