summaryrefslogtreecommitdiff
path: root/Source/cmLinkDirectoriesCommand.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2018-09-14 17:48:20 +0200
committerCraig Scott <craig.scott@crascit.com>2018-09-25 23:59:58 +1000
commita71caab46b205c2b0367c2b11c12a9b55b09bcca (patch)
treeb19ad25b6e8b87bc0e35eb7c93df8afcb6fde594 /Source/cmLinkDirectoriesCommand.cxx
parent5ca130e22394978814a9e59418529a7a3e1a61bd (diff)
downloadcmake-a71caab46b205c2b0367c2b11c12a9b55b09bcca.tar.gz
LINK_DIRECTORIES: Add new properties and commands
These new capabilities enable to manage link directories Two new properties: * target properties: LINK_DIRECTORIES and INTERFACE_LINK_DIRECTORIES One new command * target_link_directories(): to populate target properties Fixes: #17215
Diffstat (limited to 'Source/cmLinkDirectoriesCommand.cxx')
-rw-r--r--Source/cmLinkDirectoriesCommand.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx
index 1371c5352f..5c52c76033 100644
--- a/Source/cmLinkDirectoriesCommand.cxx
+++ b/Source/cmLinkDirectoriesCommand.cxx
@@ -4,6 +4,7 @@
#include <sstream>
+#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
#include "cmPolicies.h"
#include "cmSystemTools.h"
@@ -29,7 +30,8 @@ void cmLinkDirectoriesCommand::AddLinkDir(std::string const& dir)
{
std::string unixPath = dir;
cmSystemTools::ConvertToUnixSlashes(unixPath);
- if (!cmSystemTools::FileIsFullPath(unixPath)) {
+ if (!cmSystemTools::FileIsFullPath(unixPath) &&
+ !cmGeneratorExpression::StartsWithGeneratorExpression(unixPath)) {
bool convertToAbsolute = false;
std::ostringstream e;
/* clang-format off */
@@ -41,6 +43,7 @@ void cmLinkDirectoriesCommand::AddLinkDir(std::string const& dir)
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0015);
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ break;
case cmPolicies::OLD:
// OLD behavior does not convert
break;
@@ -61,5 +64,5 @@ void cmLinkDirectoriesCommand::AddLinkDir(std::string const& dir)
unixPath = tmp;
}
}
- this->Makefile->AppendProperty("LINK_DIRECTORIES", unixPath.c_str());
+ this->Makefile->AddLinkDirectory(unixPath);
}