[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1160-g562c100
Brad King
brad.king at kitware.com
Fri Nov 30 10:58:06 EST 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 562c100569f79374040aa9a04ad998b25aae20e9 (commit)
via 937e62bae4ac9fa9f55c38a2587601a7557e5e72 (commit)
via 4c32b77e207f1a6b9e7888ec75c82ff369e2c3af (commit)
via 0bc421120b3e9ce5770d31ed94a1d33ff2c5cb34 (commit)
via e078299ed317d0a56dde42fb12ac9bd279dc584a (commit)
via d6c52dc467aa9e9d76e94390fa0c829e09704e7f (commit)
via 3ce0225294330b5362f8438b13b676c50534cb7f (commit)
via 668cba21af75e61a9feac1c22c0229f3d6a0e885 (commit)
from d714bad4c6f000b90b68abceb42cb946eb0430a5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=562c100569f79374040aa9a04ad998b25aae20e9
commit 562c100569f79374040aa9a04ad998b25aae20e9
Merge: d714bad 937e62b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 30 10:56:12 2012 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Nov 30 10:56:12 2012 -0500
Merge branch 'revert-tll-genex' into next
Conflicts:
Source/cmTarget.cxx
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=937e62bae4ac9fa9f55c38a2587601a7557e5e72
commit 937e62bae4ac9fa9f55c38a2587601a7557e5e72
Merge: 4c32b77 d6c52dc
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 30 10:48:04 2012 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Nov 30 10:48:04 2012 -0500
Merge branch 'link-libraries-generator-expression' into revert-tll-genex
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c32b77e207f1a6b9e7888ec75c82ff369e2c3af
commit 4c32b77e207f1a6b9e7888ec75c82ff369e2c3af
Merge: 0bc4211 e078299
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 30 10:47:56 2012 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Nov 30 10:47:56 2012 -0500
Merge branch 'old-link-interface-genex' into revert-tll-genex
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0bc421120b3e9ce5770d31ed94a1d33ff2c5cb34
commit 0bc421120b3e9ce5770d31ed94a1d33ff2c5cb34
Merge: 0bbae6f 668cba2
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 30 10:47:46 2012 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Nov 30 10:47:46 2012 -0500
Merge branch 'add-INTERFACE_LINK_LIBRARIES-property' into revert-tll-genex
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e078299ed317d0a56dde42fb12ac9bd279dc584a
commit e078299ed317d0a56dde42fb12ac9bd279dc584a
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 30 10:44:31 2012 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Nov 30 10:46:47 2012 -0500
Revert topic 'old-link-interface-genex'
Revert commits:
f9deedc8 Export: Generate both old and new-style LINK_INTERFACE prooperties.
576c2266 Don't clear the pointer vector without first deleting the entries.
f285ad73 Use cmStdRemove workaround for ancient GCC too.
955d111c Make targets depend on the (config-specific) union of dependencies.
57627ca3 Generate the frameworks linked by a target lazily.
c8ac6faf Add cmTarget::GetDirectLinkDependencies.
ae6deb42 Add includes and compile definitions with target_link_libraries.
e3ebe1f8 Add the TARGET_DEFINED generator expression
a341626b Handle INTERFACE properties transitively for includes and defines.
05984459 Keep track of INCLUDE_DIRECTORIES as a vector of structs.
9c72d037 Use cmsys::auto_ptr to manage cmCompiledGeneratorExpressions
16ea5279 Genex: Add INTERFACE_LINK_LIBRARIES property
9737cec6 Add expressions for separating build-location from install-location.
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 2acbfff..ab77c6b 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -200,44 +200,20 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
// Get the depender.
cmTarget* depender = this->Targets[depender_index];
- // Loop over all targets linked directly in all configs.
- // We need to make targets depend on the union of all config-specific
- // dependencies in all targets, because the generated build-systems can't
- // deal with config-specific dependencies.
+ // Loop over all targets linked directly.
{
- std::vector<std::string> configs;
- depender->GetMakefile()->GetConfigurations(configs);
+ cmTarget::LinkLibraryVectorType const& tlibs =
+ depender->GetOriginalLinkLibraries();
std::set<cmStdString> emitted;
- {
- std::vector<std::string> tlibs;
- depender->GetDirectLinkLibraries(0, tlibs);
// A target should not depend on itself.
emitted.insert(depender->GetName());
- for(std::vector<std::string>::const_iterator lib = tlibs.begin();
+ for(cmTarget::LinkLibraryVectorType::const_iterator lib = tlibs.begin();
lib != tlibs.end(); ++lib)
{
// Don't emit the same library twice for this target.
- if(emitted.insert(*lib).second)
- {
- this->AddTargetDepend(depender_index, lib->c_str(), true);
- }
- }
- }
- for (std::vector<std::string>::const_iterator it = configs.begin();
- it != configs.end(); ++it)
- {
- std::vector<std::string> tlibs;
- depender->GetDirectLinkLibraries(it->c_str(), tlibs);
- // A target should not depend on itself.
- emitted.insert(depender->GetName());
- for(std::vector<std::string>::const_iterator lib = tlibs.begin();
- lib != tlibs.end(); ++lib)
+ if(emitted.insert(lib->first).second)
{
- // Don't emit the same library twice for this target.
- if(emitted.insert(*lib).second)
- {
- this->AddTargetDepend(depender_index, lib->c_str(), true);
- }
+ this->AddTargetDepend(depender_index, lib->first.c_str(), true);
}
}
}
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index f2f77ee..07df7d5 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -47,7 +47,7 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
{
return target->GetLocation(this->Config);
}
- return this->GE->Parse(argv0)->Evaluate(this->Makefile, this->Config);
+ return this->GE->Parse(argv0).Evaluate(this->Makefile, this->Config);
}
//----------------------------------------------------------------------------
@@ -58,7 +58,7 @@ cmCustomCommandGenerator
cmCustomCommandLine const& commandLine = this->CC.GetCommandLines()[c];
for(unsigned int j=1;j < commandLine.size(); ++j)
{
- std::string arg = this->GE->Parse(commandLine[j])->Evaluate(this->Makefile,
+ std::string arg = this->GE->Parse(commandLine[j]).Evaluate(this->Makefile,
this->Config);
cmd += " ";
if(this->OldStyle)
diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h
index 4866f0d..445fd0e 100644
--- a/Source/cmDocumentGeneratorExpressions.h
+++ b/Source/cmDocumentGeneratorExpressions.h
@@ -27,7 +27,6 @@
" $<COMMA> = A literal ','. Used to compare " \
"strings which contain a ',' for example.\n" \
" $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)\n" \
- " $<TARGET_DEFINED:tgt> = '1' if tgt is a target, else '0'\n" \
" $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n" \
" $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)\n" \
"where \"tgt\" is the name of a target. " \
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index c67486a..fb3f39f 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -12,7 +12,6 @@
#include "cmExportBuildFileGenerator.h"
#include "cmExportCommand.h"
-#include "cmGeneratorExpression.h"
//----------------------------------------------------------------------------
cmExportBuildFileGenerator::cmExportBuildFileGenerator()
@@ -32,23 +31,6 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
if(this->ExportedTargets.insert(te).second)
{
this->GenerateImportTargetCode(os, te);
-
- ImportPropertyMap properties;
-
- if ((*tei)->GetPolicyStatusCMP0019() == cmPolicies::NEW)
- {
- this->PopulateInterfaceProperty("INTERFACE_LINK_LIBRARIES", te,
- cmGeneratorExpression::BuildInterface,
- properties);
- }
- this->PopulateInterfaceProperty("INTERFACE_INCLUDE_DIRECTORIES", te,
- cmGeneratorExpression::BuildInterface,
- properties);
- this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", te,
- cmGeneratorExpression::BuildInterface,
- properties);
-
- this->GenerateInterfaceProperties(te, os, properties);
}
else
{
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index a67c3ee..8dffae4 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -125,50 +125,6 @@ void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
}
//----------------------------------------------------------------------------
-void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
- cmTarget *target,
- cmGeneratorExpression::PreprocessContext preprocessRule,
- ImportPropertyMap &properties)
-{
- const char *input = target->GetProperty(propName);
- if (input)
- {
- if (!*input)
- {
- // Set to empty
- properties[propName] = "";
- return;
- }
- std::string prepro = cmGeneratorExpression::Preprocess(input,
- preprocessRule,
- this->Namespace.c_str());
- if (!prepro.empty())
- {
- properties[propName] = prepro;
- }
- }
-}
-
-//----------------------------------------------------------------------------
-void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget *target,
- std::ostream& os,
- const ImportPropertyMap &properties)
-{
- if (!properties.empty())
- {
- std::string targetName = this->Namespace;
- targetName += target->GetName();
- os << "SET_TARGET_PROPERTIES(" << targetName << " PROPERTIES\n";
- for(ImportPropertyMap::const_iterator pi = properties.begin();
- pi != properties.end(); ++pi)
- {
- os << " " << pi->first << " \"" << pi->second << "\"\n";
- }
- os << ")\n\n";
- }
-}
-
-//----------------------------------------------------------------------------
void
cmExportFileGenerator
::SetImportDetailProperties(const char* config, std::string const& suffix,
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 3aee1b8..70bc65d 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -13,7 +13,6 @@
#define cmExportFileGenerator_h
#include "cmCommand.h"
-#include "cmGeneratorExpression.h"
/** \class cmExportFileGenerator
* \brief Generate a file exporting targets from a build or install tree.
@@ -92,12 +91,6 @@ protected:
cmMakefile* mf,
cmTarget* depender,
cmTarget* dependee) = 0;
- void PopulateInterfaceProperty(const char *,
- cmTarget *target,
- cmGeneratorExpression::PreprocessContext,
- ImportPropertyMap &properties);
- void GenerateInterfaceProperties(cmTarget *target, std::ostream& os,
- const ImportPropertyMap &properties);
// The namespace in which the exports are placed in the generated file.
std::string Namespace;
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index c22abf4..7841731 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -19,7 +19,6 @@
#include "cmInstallExportGenerator.h"
#include "cmInstallTargetGenerator.h"
#include "cmTargetExport.h"
-#include "cmGeneratorExpression.h"
//----------------------------------------------------------------------------
cmExportInstallFileGenerator
@@ -49,26 +48,6 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
if(this->ExportedTargets.insert(te->Target).second)
{
this->GenerateImportTargetCode(os, te->Target);
-
- ImportPropertyMap properties;
-
- if ((*tei)->Target->GetPolicyStatusCMP0019() == cmPolicies::NEW)
- {
- this->PopulateInterfaceProperty("INTERFACE_LINK_LIBRARIES",
- te->Target,
- cmGeneratorExpression::InstallInterface,
- properties);
- }
- this->PopulateInterfaceProperty("INTERFACE_INCLUDE_DIRECTORIES",
- te->Target,
- cmGeneratorExpression::InstallInterface,
- properties);
- this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS",
- te->Target,
- cmGeneratorExpression::InstallInterface,
- properties);
-
- this->GenerateInterfaceProperties(te->Target, os, properties);
}
else
{
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 97a0581..32bf941 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -25,29 +25,44 @@
//----------------------------------------------------------------------------
cmGeneratorExpression::cmGeneratorExpression(
cmListFileBacktrace const& backtrace):
- Backtrace(backtrace)
+ Backtrace(backtrace), CompiledExpression(0)
{
}
//----------------------------------------------------------------------------
-cmsys::auto_ptr<cmCompiledGeneratorExpression>
+const cmCompiledGeneratorExpression &
cmGeneratorExpression::Parse(std::string const& input)
{
return this->Parse(input.c_str());
}
//----------------------------------------------------------------------------
-cmsys::auto_ptr<cmCompiledGeneratorExpression>
+const cmCompiledGeneratorExpression &
cmGeneratorExpression::Parse(const char* input)
{
- return cmsys::auto_ptr<cmCompiledGeneratorExpression>(
- new cmCompiledGeneratorExpression(
- this->Backtrace,
- input));
+ cmGeneratorExpressionLexer l;
+ std::vector<cmGeneratorExpressionToken> tokens = l.Tokenize(input);
+ bool needsParsing = l.GetSawGeneratorExpression();
+ std::vector<cmGeneratorExpressionEvaluator*> evaluators;
+
+ if (needsParsing)
+ {
+ cmGeneratorExpressionParser p(tokens);
+ p.Parse(evaluators);
+ }
+
+ delete this->CompiledExpression;
+ this->CompiledExpression = new cmCompiledGeneratorExpression(
+ this->Backtrace,
+ evaluators,
+ input,
+ needsParsing);
+ return *this->CompiledExpression;
}
cmGeneratorExpression::~cmGeneratorExpression()
{
+ delete this->CompiledExpression;
}
//----------------------------------------------------------------------------
@@ -58,7 +73,7 @@ const char *cmCompiledGeneratorExpression::Evaluate(
{
if (!this->NeedsParsing)
{
- return this->Input.c_str();
+ return this->Input;
}
this->Output = "";
@@ -93,19 +108,12 @@ const char *cmCompiledGeneratorExpression::Evaluate(
cmCompiledGeneratorExpression::cmCompiledGeneratorExpression(
cmListFileBacktrace const& backtrace,
- const char *input)
- : Backtrace(backtrace), Input(input ? input : "")
+ const std::vector<cmGeneratorExpressionEvaluator*> &evaluators,
+ const char *input, bool needsParsing)
+ : Backtrace(backtrace), Evaluators(evaluators), Input(input),
+ NeedsParsing(needsParsing)
{
- cmGeneratorExpressionLexer l;
- std::vector<cmGeneratorExpressionToken> tokens =
- l.Tokenize(this->Input.c_str());
- this->NeedsParsing = l.GetSawGeneratorExpression();
- if (this->NeedsParsing)
- {
- cmGeneratorExpressionParser p(tokens);
- p.Parse(this->Evaluators);
- }
}
@@ -123,9 +131,15 @@ cmCompiledGeneratorExpression::~cmCompiledGeneratorExpression()
}
}
-//----------------------------------------------------------------------------
-static std::string stripAllGeneratorExpressions(const std::string &input)
+std::string cmGeneratorExpression::Preprocess(const std::string &input,
+ PreprocessContext context)
{
+ if (context != StripAllGeneratorExpressions)
+ {
+ assert(!"cmGeneratorExpression::Preprocess called with invalid args");
+ return std::string();
+ }
+
std::string result;
std::string::size_type pos = 0;
std::string::size_type lastPos = pos;
@@ -164,95 +178,3 @@ static std::string stripAllGeneratorExpressions(const std::string &input)
result += input.substr(lastPos);
return result;
}
-
-//----------------------------------------------------------------------------
-static std::string stripExportInterface(const std::string &input,
- cmGeneratorExpression::PreprocessContext context,
- const char *ns)
-{
- std::string result;
- {
- std::string::size_type pos = 0;
- std::string::size_type lastPos = pos;
- while((pos = input.find("$<BUILD_INTERFACE:", lastPos)) != input.npos
- || (pos = input.find("$<INSTALL_INTERFACE:", lastPos)) != input.npos)
- {
- result += input.substr(lastPos, pos - lastPos);
- const bool gotInstallInterface = input[pos + 2] == 'I';
- pos += gotInstallInterface ? sizeof("$<INSTALL_INTERFACE:") - 1
- : sizeof("$<BUILD_INTERFACE:") - 1;
- int nestingLevel = 1;
- const char *c = input.c_str() + pos;
- const char * const cStart = c;
- for ( ; *c; ++c)
- {
- if(c[0] == '$' && c[1] == '<')
- {
- ++nestingLevel;
- ++c;
- continue;
- }
- if(c[0] == '>')
- {
- --nestingLevel;
- if (nestingLevel != 0)
- {
- continue;
- }
- if(context == cmGeneratorExpression::BuildInterface
- && !gotInstallInterface)
- {
- result += input.substr(pos, c - cStart);
- }
- else if(context == cmGeneratorExpression::InstallInterface
- && gotInstallInterface)
- {
- result += input.substr(pos, c - cStart);
- }
- break;
- }
- }
- const std::string::size_type traversed = (c - cStart) + 1;
- if (!*c)
- {
- result += std::string(gotInstallInterface ? "$<INSTALL_INTERFACE:"
- : "$<BUILD_INTERFACE:")
- + input.substr(pos, traversed);
- }
- pos += traversed;
- lastPos = pos;
- }
- result += input.substr(lastPos);
- }
-
- {
- std::string::size_type pos = 0;
- std::string::size_type lastPos = pos;
-
- std::string expNs = ns ? ns : "";
- while((pos = result.find("$<EXPORT_NAMESPACE>", lastPos)) != input.npos)
- {
- result.replace(pos, sizeof("$<EXPORT_NAMESPACE>") - 1, expNs);
- pos += sizeof("$<EXPORT_NAMESPACE>") - 1;
- }
- }
- return result;
-}
-
-//----------------------------------------------------------------------------
-std::string cmGeneratorExpression::Preprocess(const std::string &input,
- PreprocessContext context,
- const char *ns)
-{
- if (context == StripAllGeneratorExpressions)
- {
- return stripAllGeneratorExpressions(input);
- }
- else if (context == BuildInterface || context == InstallInterface)
- {
- return stripExportInterface(input, context, ns);
- }
-
- assert(!"cmGeneratorExpression::Preprocess called with invalid args");
- return std::string();
-}
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index c3daf84..ea3e7d0 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -14,12 +14,10 @@
#define cmGeneratorExpression_h
#include "cmStandardIncludes.h"
-#include "cmListFileCache.h"
#include <stack>
#include <cmsys/RegularExpression.hxx>
-#include <cmsys/auto_ptr.hxx>
class cmTarget;
class cmMakefile;
@@ -46,25 +44,22 @@ public:
cmGeneratorExpression(cmListFileBacktrace const& backtrace);
~cmGeneratorExpression();
- cmsys::auto_ptr<cmCompiledGeneratorExpression> Parse(
- std::string const& input);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> Parse(const char* input);
+ const cmCompiledGeneratorExpression& Parse(std::string const& input);
+ const cmCompiledGeneratorExpression& Parse(const char* input);
enum PreprocessContext {
- StripAllGeneratorExpressions,
- BuildInterface,
- InstallInterface
+ StripAllGeneratorExpressions
};
static std::string Preprocess(const std::string &input,
- PreprocessContext context,
- const char *ns = 0);
+ PreprocessContext context);
private:
cmGeneratorExpression(const cmGeneratorExpression &);
void operator=(const cmGeneratorExpression &);
cmListFileBacktrace const& Backtrace;
+ cmCompiledGeneratorExpression *CompiledExpression;
};
class cmCompiledGeneratorExpression
@@ -81,24 +76,20 @@ public:
~cmCompiledGeneratorExpression();
- std::string GetInput() const
- {
- return this->Input;
- }
-
private:
cmCompiledGeneratorExpression(cmListFileBacktrace const& backtrace,
- const char *input);
+ const std::vector<cmGeneratorExpressionEvaluator*> &evaluators,
+ const char *input, bool needsParsing);
friend class cmGeneratorExpression;
cmCompiledGeneratorExpression(const cmCompiledGeneratorExpression &);
void operator=(const cmCompiledGeneratorExpression &);
- cmListFileBacktrace Backtrace;
- std::vector<cmGeneratorExpressionEvaluator*> Evaluators;
- const std::string Input;
- bool NeedsParsing;
+ cmListFileBacktrace const& Backtrace;
+ const std::vector<cmGeneratorExpressionEvaluator*> Evaluators;
+ const char* const Input;
+ const bool NeedsParsing;
mutable std::set<cmTarget*> Targets;
mutable std::string Output;
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 9c6ea23..c609000 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -94,31 +94,6 @@ static const struct OneNode : public cmGeneratorExpressionNode
} oneNode;
//----------------------------------------------------------------------------
-static const struct OneNode buildInterfaceNode;
-
-//----------------------------------------------------------------------------
-static const struct ZeroNode installInterfaceNode;
-
-//----------------------------------------------------------------------------
-static const struct NullNode : public cmGeneratorExpressionNode
-{
- NullNode() {}
-
- virtual bool GeneratesContent() const { return false; }
-
- std::string Evaluate(const std::vector<std::string> &,
- cmGeneratorExpressionContext *,
- const GeneratorExpressionContent *,
- cmGeneratorExpressionDAGChecker *) const
- {
- return std::string();
- }
-
- virtual int NumExpectedParameters() const { return 0; }
-
-} nullNode;
-
-//----------------------------------------------------------------------------
#define BOOLEAN_OP_NODE(OPNAME, OP, SUCCESS_VALUE, FAILURE_VALUE) \
static const struct OP ## Node : public cmGeneratorExpressionNode \
{ \
@@ -286,29 +261,6 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
} configurationTestNode;
//----------------------------------------------------------------------------
-static const struct TargetTestNode : public cmGeneratorExpressionNode
-{
- TargetTestNode() {}
-
- virtual int NumExpectedParameters() const { return 1; }
-
- std::string Evaluate(const std::vector<std::string> ¶meters,
- cmGeneratorExpressionContext *context,
- const GeneratorExpressionContent *,
- cmGeneratorExpressionDAGChecker *) const
- {
- return context->Makefile->FindTargetToUse(parameters.front().c_str())
- ? "1" : "0";
- }
-} targetTestNode;
-
-//----------------------------------------------------------------------------
-static const char* targetPropertyTransitiveWhitelist[] = {
- "INTERFACE_INCLUDE_DIRECTORIES"
- , "INTERFACE_COMPILE_DEFINITIONS"
-};
-
-//----------------------------------------------------------------------------
static const struct TargetPropertyNode : public cmGeneratorExpressionNode
{
TargetPropertyNode() {}
@@ -410,27 +362,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
const char *prop = target->GetProperty(propertyName.c_str());
- if (!prop)
- {
- return std::string();
- }
-
- for (size_t i = 0;
- i < (sizeof(targetPropertyTransitiveWhitelist) /
- sizeof(*targetPropertyTransitiveWhitelist));
- ++i)
- {
- if (targetPropertyTransitiveWhitelist[i] == propertyName)
- {
- cmGeneratorExpression ge(context->Backtrace);
- return ge.Parse(prop)->Evaluate(context->Makefile,
- context->Config,
- context->Quiet,
- context->Target,
- &dagChecker);
- }
- }
- return prop;
+ return prop ? prop : "";
}
} targetPropertyNode;
@@ -659,14 +591,6 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
return &commaNode;
else if (identifier == "TARGET_PROPERTY")
return &targetPropertyNode;
- else if (identifier == "BUILD_INTERFACE")
- return &buildInterfaceNode;
- else if (identifier == "INSTALL_INTERFACE")
- return &installInterfaceNode;
- else if (identifier == "EXPORT_NAMESPACE")
- return &nullNode;
- else if (identifier == "TARGET_DEFINED")
- return &targetTestNode;
return 0;
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 62ee26a..de8b5e3 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -252,7 +252,45 @@ const char* cmGeneratorTarget::GetCreateRuleVariable()
std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
const char *config)
{
- return this->Target->GetIncludeDirectories(config);
+ std::vector<std::string> includes;
+ const char *prop = this->Target->GetProperty("INCLUDE_DIRECTORIES");
+ if(!prop)
+ {
+ return includes;
+ }
+
+ cmListFileBacktrace lfbt;
+ cmGeneratorExpression ge(lfbt);
+
+ cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ this->GetName(),
+ "INCLUDE_DIRECTORIES", 0, 0);
+
+ cmSystemTools::ExpandListArgument(ge.Parse(prop)
+ .Evaluate(this->Makefile,
+ config,
+ false,
+ this->Target,
+ &dagChecker),
+ includes);
+
+ std::set<std::string> uniqueIncludes;
+ std::vector<std::string> orderedAndUniqueIncludes;
+ for(std::vector<std::string>::const_iterator
+ li = includes.begin(); li != includes.end(); ++li)
+ {
+ std::string inc = *li;
+ if (!cmSystemTools::IsOff(inc.c_str()))
+ {
+ cmSystemTools::ConvertToUnixSlashes(inc);
+ }
+ if(uniqueIncludes.insert(inc).second)
+ {
+ orderedAndUniqueIncludes.push_back(inc);
+ }
+ }
+
+ return orderedAndUniqueIncludes;
}
//----------------------------------------------------------------------------
@@ -277,7 +315,7 @@ std::string cmGeneratorTarget::GetCompileDefinitions(const char *config)
cmGeneratorExpressionDAGChecker dagChecker(lfbt,
this->GetName(),
defPropName, 0, 0);
- return ge.Parse(prop)->Evaluate(this->Makefile,
+ return ge.Parse(prop).Evaluate(this->Makefile,
config,
false,
this->Target,
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index d9b586e..9bbeeaf 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1997,8 +1997,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
dirs.Add(incpath.c_str());
}
}
- std::vector<std::string> frameworks;
- target.GetFrameworks(configName, frameworks);
+ std::vector<std::string>& frameworks = target.GetFrameworks();
if(frameworks.size())
{
for(std::vector<std::string>::iterator fmIt = frameworks.begin();
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 5fa10f2..8498d72 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1665,14 +1665,8 @@ void cmMakefile::AddIncludeDirectory(const char* inc, bool before)
l != this->Targets.end(); ++l)
{
cmTarget &t = l->second;
- if (before)
- {
- t.PrependTLLIncludeDirectories(inc);
- }
- else
- {
- t.AppendTLLIncludeDirectories(inc);
- }
+ prop = t.GetProperties().GetOrCreateProperty("INCLUDE_DIRECTORIES");
+ AddStringToProperty(prop, "INCLUDE_DIRECTORIES", inc, before);
}
}
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index f46edf3..2b89c79 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1565,8 +1565,7 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags()
}
std::string flags;
- std::vector<std::string> frameworks;
- this->Target->GetFrameworks(config, frameworks);
+ std::vector<std::string>& frameworks = this->Target->GetFrameworks();
for(i = frameworks.begin();
i != frameworks.end(); ++i)
{
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 13e36c8..6aef502 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -491,43 +491,6 @@ cmPolicies::cmPolicies()
"CMAKE_SHARED_LIBRARY_<Lang>_FLAGS whether it is modified or not and "
"honor the POSITION_INDEPENDENT_CODE target property.",
2,8,9,0, cmPolicies::WARN);
-
- this->DefinePolicy(
- CMP0019, "CMP0019",
- "Use INTERFACE_LINK_LIBRARIES instead of LINK_INTERFACE_LIBRARIES.",
- "CMake 2.8.10 used the (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? "
- "properties to determine the link interface. CMake 2.8.11 and higher "
- "prefer instead to use the INTERFACE_LINK_LIBRARIES target property to "
- "determine the link interface, while ignoring "
- "(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? completely. The new "
- "INTERFACE_LINK_LIBRARIES target property can use generator expressions "
- "to specify config-specific link libraries."
- "\n"
- "The OLD behavior for this policy is to ignore the "
- "INTERFACE_LINK_LIBRARIES property for all targets and use the "
- "value of (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? instead."
- "\n"
- "The NEW behavior for this policy is to ignore "
- "the value of the (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? target "
- "property",
- 2,8,11,0, cmPolicies::WARN);
-
- this->DefinePolicy(
- CMP0020, "CMP0020",
- "Use INCLUDE_DIRECTORIES order implied by target_link_libraries.",
- "CMake 2.8.11 introduced a feature where using target_link_libraries "
- "can read the INTERFACE_INCLUDE_DIRECTORIES property of a target and "
- "use the value as include directories when compiling. Because the "
- "target_link_libraries call might occur before the include_directories "
- "call, this could change the order of includes in the compile step."
- "\n"
- "The OLD behavior for this policy is to let the include_directories call "
- "determine the order of includes."
- "\n"
- "The NEW behavior for this policy is to use the order of includes "
- "determined by the order of all calls to target_link_libraries and "
- "include_directories",
- 2,8,11,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 94154ee..6932565 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -68,8 +68,6 @@ public:
CMP0018, ///< Ignore language flags for shared libs, and adhere to
/// POSITION_INDEPENDENT_CODE property and *_COMPILE_OPTIONS_PI{E,C}
/// instead.
- CMP0019, ///< Use new-style INTERFACE_LINK_LIBRARIES
- CMP0020, ///< Use INCLUDE_DIRECTORIES order from target_link_libraries
/** \brief Always the last entry.
*
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 5ab9bdc..be20464 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -21,7 +21,6 @@
#include "cmDocumentLocationUndefined.h"
#include "cmListFileCache.h"
#include "cmGeneratorExpression.h"
-#include "cmGeneratorExpressionDAGChecker.h"
#include <cmsys/RegularExpression.hxx>
#include <map>
#include <set>
@@ -119,18 +118,6 @@ public:
struct SourceEntry { std::vector<cmSourceFile*> Depends; };
typedef std::map<cmSourceFile*, SourceEntry> SourceEntriesType;
SourceEntriesType SourceEntries;
-
- struct IncludeDirectoriesEntry {
- IncludeDirectoriesEntry(
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge,
- bool tllEntry = false)
- : ge(cge), ImpliedByTargetLinkLibraries(tllEntry)
- {}
- const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
- const bool ImpliedByTargetLinkLibraries;
- };
- std::vector<IncludeDirectoriesEntry*> IncludeDirectoriesEntries;
- std::string IncludeDirectoriesString;
};
//----------------------------------------------------------------------------
@@ -140,7 +127,6 @@ cmTarget::cmTarget()
this->PolicyStatusCMP0003 = cmPolicies::WARN;
this->PolicyStatusCMP0004 = cmPolicies::WARN;
this->PolicyStatusCMP0008 = cmPolicies::WARN;
- this->PolicyStatusCMP0019 = cmPolicies::WARN;
this->LinkLibrariesAnalyzed = false;
this->HaveInstallRule = false;
this->DLLPlatform = false;
@@ -1423,8 +1409,6 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->Makefile->GetPolicyStatus(cmPolicies::CMP0004);
this->PolicyStatusCMP0008 =
this->Makefile->GetPolicyStatus(cmPolicies::CMP0008);
- this->PolicyStatusCMP0019 =
- this->Makefile->GetPolicyStatus(cmPolicies::CMP0019);
}
//----------------------------------------------------------------------------
@@ -1744,10 +1728,9 @@ cmTargetTraceDependencies
for(cmCustomCommandLine::const_iterator cli = cit->begin();
cli != cit->end(); ++cli)
{
- const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge
- = ge.Parse(*cli);
- cge->Evaluate(this->Makefile, 0, true);
- std::set<cmTarget*> geTargets = cge->GetTargets();
+ const cmCompiledGeneratorExpression &cge = ge.Parse(*cli);
+ cge.Evaluate(this->Makefile, 0, true);
+ std::set<cmTarget*> geTargets = cge.GetTargets();
for(std::set<cmTarget*>::const_iterator it = geTargets.begin();
it != geTargets.end(); ++it)
{
@@ -2110,69 +2093,23 @@ bool cmTarget::NameResolvesToFramework(const std::string& libname)
}
//----------------------------------------------------------------------------
-void cmTarget::GetFrameworks(const char *config,
- std::vector<std::string> &frameworks)
+bool cmTarget::AddFramework(const std::string& libname, LinkLibraryType)
{
- std::vector<std::string> llibs;
- this->GetDirectLinkLibraries(config, llibs);
- for(std::vector<std::string>::const_iterator li = llibs.begin();
- li != llibs.end(); ++li)
+ if(this->NameResolvesToFramework(libname.c_str()))
{
- if(this->NameResolvesToFramework(li->c_str()))
+ std::string frameworkDir = libname;
+ frameworkDir += "/../";
+ frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str());
+ std::vector<std::string>::iterator i =
+ std::find(this->Frameworks.begin(),
+ this->Frameworks.end(), frameworkDir);
+ if(i == this->Frameworks.end())
{
- std::string frameworkDir = *li + "/../";
- frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str());
- std::vector<std::string>::iterator i =
- std::find(frameworks.begin(),
- frameworks.end(), frameworkDir);
- if(i == frameworks.end())
- {
- frameworks.push_back(frameworkDir);
- }
+ this->Frameworks.push_back(frameworkDir);
}
+ return true;
}
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::GetDirectLinkLibraries(const char *config,
- std::vector<std::string> &libs) const
-{
- const char *prop = const_cast<cmTarget*>(this)
- ->GetProperty("LINK_LIBRARIES");
- if (prop)
- {
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
-
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "LINK_LIBRARIES", 0, 0);
- cmSystemTools::ExpandListArgument(ge.Parse(prop)->Evaluate(this->Makefile,
- config,
- false,
- const_cast<cmTarget*>(this),
- &dagChecker),
- libs);
- }
-}
-
-//----------------------------------------------------------------------------
-static std::string generatorIface(const std::string &value,
- cmTarget::LinkLibraryType llt)
-{
- if (llt == cmTarget::DEBUG)
- {
- return "$<$<CONFIG:Debug>:"
- + value
- + ">";
- }
- else if (llt == cmTarget::OPTIMIZED)
- {
- return "$<$<NOT:$<CONFIG:Debug>>:"
- + value
- + ">";
- }
- return value;
+ return false;
}
//----------------------------------------------------------------------------
@@ -2185,21 +2122,9 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
{
return;
}
-
- this->AppendProperty("LINK_LIBRARIES",
- generatorIface(lib, llt).c_str());
-
- std::string pplib = cmGeneratorExpression::Preprocess(
- lib,
- cmGeneratorExpression::StripAllGeneratorExpressions);
-
- if (pplib.empty())
- {
- return;
- }
-
+ this->AddFramework(lib, llt);
cmTarget::LibraryID tmp;
- tmp.first = pplib;
+ tmp.first = lib;
tmp.second = llt;
this->LinkLibraries.push_back( tmp );
this->OriginalLinkLibraries.push_back(tmp);
@@ -2236,7 +2161,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
break;
}
dependencies += ";";
- dependencies += pplib;
+ dependencies += lib;
dependencies += ";";
mf.AddCacheDefinition( targetEntry.c_str(), dependencies.c_str(),
"Dependencies for the target",
@@ -2541,20 +2466,6 @@ void cmTarget::GatherDependencies( const cmMakefile& mf,
}
//----------------------------------------------------------------------------
-void deleteAndClear(
- std::vector<cmTargetInternals::IncludeDirectoriesEntry*> &entries)
-{
- for (std::vector<cmTargetInternals::IncludeDirectoriesEntry*>::const_iterator
- it = entries.begin(),
- end = entries.end();
- it != end; ++it)
- {
- delete *it;
- }
- entries.clear();
-}
-
-//----------------------------------------------------------------------------
void cmTarget::SetProperty(const char* prop, const char* value)
{
if (!prop)
@@ -2562,16 +2473,6 @@ void cmTarget::SetProperty(const char* prop, const char* value)
return;
}
- if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
- {
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
- deleteAndClear(this->Internal->IncludeDirectoriesEntries);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
- this->Internal->IncludeDirectoriesEntries.push_back(
- new cmTargetInternals::IncludeDirectoriesEntry(cge));
- return;
- }
this->Properties.SetProperty(prop, value, cmProperty::TARGET);
this->MaybeInvalidatePropertyCache(prop);
}
@@ -2584,141 +2485,11 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
{
return;
}
- if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
- {
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
- this->Internal->IncludeDirectoriesEntries.push_back(
- new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(value)));
- return;
- }
this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString);
this->MaybeInvalidatePropertyCache(prop);
}
//----------------------------------------------------------------------------
-void cmTarget::AppendTLLIncludeDirectories(const std::string &includes)
-{
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
- this->Internal->IncludeDirectoriesEntries.push_back(
- new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(includes),
- true)
- );
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::PrependTLLIncludeDirectories(const std::string &includes)
-{
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
- this->Internal->IncludeDirectoriesEntries.insert(
- this->Internal->IncludeDirectoriesEntries.begin(),
- new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(includes),
- true)
- );
-}
-
-// A Borland machine on the dashboard has a faulty std::remove.
-template <typename ForwardIterator, typename T>
-ForwardIterator cmStdRemove(ForwardIterator first,
- ForwardIterator last,
- const T& value)
-{
-#if defined(__BORLANDC__) || (defined(__GNUC__) && __GNUC__ < 3)
- ForwardIterator result = first;
- for ( ; first != last; ++first)
- {
- if (!(*first == value))
- {
- *result++ = *first;
- }
- }
- return result;
-#else
- return std::remove<ForwardIterator, T>(first, last, value);
-#endif
-}
-
-//----------------------------------------------------------------------------
-std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
-{
- std::set<std::string> fromTll;
- std::vector<std::string> includes;
- std::set<std::string> uniqueIncludes;
- cmListFileBacktrace lfbt;
-
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "INCLUDE_DIRECTORIES", 0, 0);
-
- for (std::vector<cmTargetInternals::IncludeDirectoriesEntry*>::const_iterator
- it = this->Internal->IncludeDirectoriesEntries.begin(),
- end = this->Internal->IncludeDirectoriesEntries.end();
- it != end; ++it)
- {
- std::vector<std::string> entryIncludes;
- cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(this->Makefile,
- config,
- false,
- this,
- &dagChecker),
- entryIncludes);
- for(std::vector<std::string>::const_iterator
- li = entryIncludes.begin(); li != entryIncludes.end(); ++li)
- {
- std::string inc = *li;
- if (!cmSystemTools::IsOff(inc.c_str()))
- {
- cmSystemTools::ConvertToUnixSlashes(inc);
- }
-
- if (!(*it)->ImpliedByTargetLinkLibraries)
- {
- if (fromTll.find(*li) != fromTll.end())
- {
- switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0020))
- {
- case cmPolicies::WARN:
- {
- cmOStringStream e;
- e << "The include directory " << *li << " was specified "
- "implicitly by an earlier call to target_link_libraries. "
- "Preserving the order of includes as if the earlier use of "
- "target_link_libraries had not added it."
- << this->Makefile->GetPolicies()->GetPolicyWarning(
- cmPolicies::CMP0020);
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
- }
- // Fall through to OLD behavior
- case cmPolicies::OLD:
- includes.erase(cmStdRemove(includes.begin(),
- includes.end(), *li),
- includes.end());
- fromTll.erase(*li);
- includes.push_back(*li);
- break;
- case cmPolicies::REQUIRED_ALWAYS:
- case cmPolicies::REQUIRED_IF_USED:
- case cmPolicies::NEW:
- break;
- }
- }
- }
- if(uniqueIncludes.insert(inc).second)
- {
- if ((*it)->ImpliedByTargetLinkLibraries)
- {
- fromTll.insert(*li);
- }
- includes.push_back(*li);
- }
- }
- }
- return includes;
-}
-
-//----------------------------------------------------------------------------
void cmTarget::MaybeInvalidatePropertyCache(const char* prop)
{
// Wipe out maps caching information affected by this property.
@@ -3044,23 +2815,6 @@ const char *cmTarget::GetProperty(const char* prop,
}
}
}
- if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
- {
- this->Internal->IncludeDirectoriesString = "";
- std::string sep;
- typedef cmTargetInternals::IncludeDirectoriesEntry
- IncludeDirectoriesEntry;
- for (std::vector<IncludeDirectoriesEntry*>::const_iterator
- it = this->Internal->IncludeDirectoriesEntries.begin(),
- end = this->Internal->IncludeDirectoriesEntries.end();
- it != end; ++it)
- {
- this->Internal->IncludeDirectoriesString += sep;
- this->Internal->IncludeDirectoriesString += (*it)->ge->GetInput();
- sep = ";";
- }
- return this->Internal->IncludeDirectoriesString.c_str();
- }
}
if (strcmp(prop,"IMPORTED") == 0)
@@ -4484,28 +4238,6 @@ cmTarget::GetImportInfo(const char* config)
return &i->second;
}
-
-bool handleCMP0019(const std::vector<std::string> &newLinkLibraries,
- const std::vector<std::string> &oldLinkLibraries)
-{
- if (newLinkLibraries.size() != oldLinkLibraries.size())
- {
- return false;
- }
- for(std::vector<std::string>::const_iterator
- oll = oldLinkLibraries.begin(), nll = newLinkLibraries.begin();
- oll != oldLinkLibraries.end() && nll != newLinkLibraries.end();
- ++oll, ++nll)
- {
- if (*oll != *nll)
- {
- return false;
- }
- }
- return true;
-}
-
-
//----------------------------------------------------------------------------
void cmTarget::ComputeImportInfo(std::string const& desired_config,
ImportInfo& info)
@@ -4709,79 +4441,21 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
// Get the link interface.
{
- std::vector<std::string> newInterfaceLibs;
- const char* newStyleLibsProp = this->GetProperty("INTERFACE_LINK_LIBRARIES");
- if(newStyleLibsProp)
- {
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
-
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "INTERFACE_LINK_LIBRARIES", 0, 0);
- cmSystemTools::ExpandListArgument(ge.Parse(newStyleLibsProp)
- ->Evaluate(this->Makefile,
- desired_config.c_str(),
- false,
- this,
- &dagChecker),
- newInterfaceLibs);
- }
-
std::string linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES";
- std::vector<std::string> oldInterfaceLibs;
- const char *oldProp = this->GetProperty((linkProp + suffix).c_str());
- if(oldProp)
- {
- linkProp += suffix;
- cmSystemTools::ExpandListArgument(oldProp,
- oldInterfaceLibs);
- }
- else
+ linkProp += suffix;
+ if(const char* config_libs = this->GetProperty(linkProp.c_str()))
{
- oldProp = this->GetProperty("IMPORTED_LINK_INTERFACE_LIBRARIES");
- if(oldProp)
- {
- cmSystemTools::ExpandListArgument(oldProp,
- oldInterfaceLibs);
- }
+ cmSystemTools::ExpandListArgument(config_libs,
+ info.LinkInterface.Libraries);
}
-
- std::vector<std::string> usedLinkLibraries;
- switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0019))
+ else if(const char* libs =
+ this->GetProperty("IMPORTED_LINK_INTERFACE_LIBRARIES"))
{
- case cmPolicies::WARN:
- {
- if (newStyleLibsProp && oldProp
- && !handleCMP0019(newInterfaceLibs, oldInterfaceLibs))
- {
- cmOStringStream e;
- e << "The " << linkProp << " and "
- "LINK_INTERFACE_LIBRARIES are not the same for target \""
- << this->GetName() << "\". NEW content is \""
- << (newStyleLibsProp ? newStyleLibsProp : "(unset)") << "\"\n"
- "OLD content is \""
- << (oldProp ? oldProp : "(unset)") << "\"\n"
- << this->Makefile->GetPolicies()->GetPolicyWarning(
- cmPolicies::CMP0019);
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
- }
- // fall through to OLD behaviour
- }
- case cmPolicies::OLD:
- usedLinkLibraries = oldInterfaceLibs;
- break;
- case cmPolicies::REQUIRED_IF_USED:
- case cmPolicies::REQUIRED_ALWAYS:
- case cmPolicies::NEW:
- default:
- usedLinkLibraries = newInterfaceLibs;
+ cmSystemTools::ExpandListArgument(libs,
+ info.LinkInterface.Libraries);
}
- info.LinkInterface.Libraries.insert(info.LinkInterface.Libraries.end(),
- usedLinkLibraries.begin(), usedLinkLibraries.end());
}
-
// Get the link dependencies.
{
std::string linkProp = "IMPORTED_LINK_DEPENDENT_LIBRARIES";
@@ -4888,81 +4562,20 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface)
// An explicit list of interface libraries may be set for shared
// libraries and executables that export symbols.
- bool explicitLibraries = false;
- std::vector<std::string> usedLinkLibraries;
+ const char* explicitLibraries = 0;
if(this->GetType() == cmTarget::SHARED_LIBRARY ||
this->IsExecutableWithExports())
{
- const char *newLibrariesProp =
- this->GetProperty("INTERFACE_LINK_LIBRARIES");
-
- std::vector<std::string> newInterfaceLibs;
- std::vector<std::string> oldInterfaceLibs;
-
- if(newLibrariesProp)
- {
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
-
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "INTERFACE_LINK_LIBRARIES", 0, 0);
-
- cmSystemTools::ExpandListArgument(ge.Parse(newLibrariesProp)->Evaluate(
- this->Makefile,
- config,
- false,
- this,
- &dagChecker), newInterfaceLibs);
- }
// Lookup the per-configuration property.
std::string propName = "LINK_INTERFACE_LIBRARIES";
propName += suffix;
- const char *oldLibrariesProp = this->GetProperty(propName.c_str());
+ explicitLibraries = this->GetProperty(propName.c_str());
// If not set, try the generic property.
- if(!oldLibrariesProp)
- {
- oldLibrariesProp = this->GetProperty("LINK_INTERFACE_LIBRARIES");
- }
- if(oldLibrariesProp)
+ if(!explicitLibraries)
{
- cmSystemTools::ExpandListArgument(oldLibrariesProp, oldInterfaceLibs);
+ explicitLibraries = this->GetProperty("LINK_INTERFACE_LIBRARIES");
}
-
- {
- switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0019))
- {
- case cmPolicies::WARN:
- {
- if (newLibrariesProp && oldLibrariesProp
- && !handleCMP0019(newInterfaceLibs, oldInterfaceLibs))
- {
- cmOStringStream e;
- e << "The INTERFACE_LINK_LIBRARIES and LINK_INTERFACE_LIBRARIES are "
- "not the same for target \"" << this->GetName() << "\".\n"
- "NEW content is \""
- << (newLibrariesProp ? newLibrariesProp : "(unset)") << "\"\n"
- "OLD content is \""
- << (oldLibrariesProp ? oldLibrariesProp : "(unset)") << "\"\n"
- << this->Makefile->GetPolicies()->GetPolicyWarning(
- cmPolicies::CMP0019);
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
- }
- // fall through to OLD behaviour
- }
- case cmPolicies::OLD:
- explicitLibraries = oldLibrariesProp ? true : false;
- usedLinkLibraries = oldInterfaceLibs;
- break;
- case cmPolicies::REQUIRED_IF_USED:
- case cmPolicies::REQUIRED_ALWAYS:
- case cmPolicies::NEW:
- default:
- usedLinkLibraries = newInterfaceLibs;
- explicitLibraries = newLibrariesProp ? true : false;
- }
- }
}
// There is no implicit link interface for executables or modules
@@ -4979,8 +4592,7 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface)
if(explicitLibraries)
{
// The interface libraries have been explicitly set.
- iface.Libraries.insert(iface.Libraries.end(),
- usedLinkLibraries.begin(), usedLinkLibraries.end());
+ cmSystemTools::ExpandListArgument(explicitLibraries, iface.Libraries);
if(this->GetType() == cmTarget::SHARED_LIBRARY)
{
@@ -5086,19 +4698,21 @@ void cmTarget::ComputeLinkImplementation(const char* config,
cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
// Collect libraries directly linked in this configuration.
- std::vector<std::string> llibs;
- this->GetDirectLinkLibraries(config, llibs);
- for(std::vector<std::string>::const_iterator li = llibs.begin();
+ LinkLibraryVectorType const& llibs = this->GetOriginalLinkLibraries();
+ for(cmTarget::LinkLibraryVectorType::const_iterator li = llibs.begin();
li != llibs.end(); ++li)
{
// Skip entries that resolve to the target itself or are empty.
- std::string item = this->CheckCMP0004(*li);
+ std::string item = this->CheckCMP0004(li->first);
if(item == this->GetName() || item.empty())
{
continue;
}
- // The entry is meant for this configuration.
- impl.Libraries.push_back(item);
+ if(li->second == cmTarget::GENERAL || li->second == linkType)
+ {
+ // The entry is meant for this configuration.
+ impl.Libraries.push_back(item);
+ }
}
LinkLibraryVectorType const& oldllibs = this->GetOriginalLinkLibraries();
@@ -5325,7 +4939,6 @@ cmTargetInternalPointer
//----------------------------------------------------------------------------
cmTargetInternalPointer::~cmTargetInternalPointer()
{
- deleteAndClear(this->Pointer->IncludeDirectoriesEntries);
delete this->Pointer;
}
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 3cd35f4..9efd638 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -99,10 +99,6 @@ public:
cmPolicies::PolicyStatus GetPolicyStatusCMP0008() const
{ return this->PolicyStatusCMP0008; }
- /** Get the status of policy CMP0019 when the target was created. */
- cmPolicies::PolicyStatus GetPolicyStatusCMP0019() const
- { return this->PolicyStatusCMP0019; }
-
/**
* Get the list of the custom commands for this target
*/
@@ -114,8 +110,7 @@ public:
{return this->PostBuildCommands;}
///! Return the list of frameworks being linked to this target
- void GetFrameworks(const char *config,
- std::vector<std::string> &frameworks);
+ std::vector<std::string> &GetFrameworks() {return this->Frameworks;}
/**
* Get the list of the source files used by this target
@@ -173,8 +168,6 @@ public:
return this->LinkLibraries;}
const LinkLibraryVectorType &GetOriginalLinkLibraries() const
{return this->OriginalLinkLibraries;}
- void GetDirectLinkLibraries(const char *config,
- std::vector<std::string> &) const;
/** Compute the link type to use for the given configuration. */
LinkLibraryType ComputeLinkType(const char* config);
@@ -186,6 +179,7 @@ public:
// Check to see if a library is a framework and treat it different on Mac
bool NameResolvesToFramework(const std::string& libname);
+ bool AddFramework(const std::string& lib, LinkLibraryType llt);
void AddLinkLibrary(cmMakefile& mf,
const char *target, const char* lib,
LinkLibraryType llt);
@@ -480,11 +474,6 @@ public:
/** @return the Mac framework directory without the base. */
std::string GetFrameworkDirectory(const char* config = 0);
- void AppendTLLIncludeDirectories(const std::string &includes);
- void PrependTLLIncludeDirectories(const std::string &includes);
-
- std::vector<std::string> GetIncludeDirectories(const char *config);
-
private:
/**
* A list of direct dependencies. Use in conjunction with DependencyMap.
@@ -580,6 +569,7 @@ private:
LinkLibraryVectorType LinkLibraries;
LinkLibraryVectorType PrevLinkedLibraries;
bool LinkLibrariesAnalyzed;
+ std::vector<std::string> Frameworks;
std::vector<std::string> LinkDirectories;
std::set<cmStdString> LinkDirectoriesEmmitted;
bool HaveInstallRule;
@@ -628,7 +618,6 @@ private:
cmPolicies::PolicyStatus PolicyStatusCMP0003;
cmPolicies::PolicyStatus PolicyStatusCMP0004;
cmPolicies::PolicyStatus PolicyStatusCMP0008;
- cmPolicies::PolicyStatus PolicyStatusCMP0019;
// Internal representation details.
friend class cmTargetInternals;
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 2ccdc01..f42b0f6 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -232,11 +232,7 @@ bool cmTargetLinkLibrariesCommand
{
this->Target->SetProperty("LINK_INTERFACE_LIBRARIES", "");
}
- if(this->CurrentProcessingState != ProcessingLinkLibraries &&
- !this->Target->GetProperty("INTERFACE_LINK_LIBRARIES"))
- {
- this->Target->SetProperty("INTERFACE_LINK_LIBRARIES", "");
- }
+
return true;
}
@@ -254,71 +250,10 @@ cmTargetLinkLibrariesCommand
}
//----------------------------------------------------------------------------
-static std::string generatorIface(const std::string &value,
- cmTarget::LinkLibraryType llt)
-{
- if (llt == cmTarget::DEBUG)
- {
- return "$<$<CONFIG:Debug>:"
- + value
- + ">";
- }
- else if (llt == cmTarget::OPTIMIZED)
- {
- return "$<$<NOT:$<CONFIG:Debug>>:"
- + value
- + ">";
- }
- return value;
-}
-
-//----------------------------------------------------------------------------
-static std::string compileProperty(const std::string &lib,
- const std::string &property,
- cmTarget::LinkLibraryType llt)
-{
- return generatorIface(std::string("$<$<TARGET_DEFINED:" + lib + ">"
- ":$<TARGET_PROPERTY:")
- + lib
- + ",INTERFACE_" + property + ">>", llt);
-}
-
-//----------------------------------------------------------------------------
-static bool isGeneratorExpression(const std::string &lib)
-{
- const std::string::size_type openpos = lib.find("$<");
- return (openpos != std::string::npos)
- && (lib.find(">", openpos) != std::string::npos);
-}
-
-//----------------------------------------------------------------------------
-static bool isList(const char *lib)
-{
- std::vector<std::string> result;
- cmSystemTools::ExpandListArgument(lib, result);
- return result.size() > 1;
-}
-
-//----------------------------------------------------------------------------
void
cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
cmTarget::LinkLibraryType llt)
{
- cmTarget *tgt = this->Makefile->FindTargetToUse(lib);
- const bool isNonImportedTarget = tgt && !tgt->IsImported();
- const bool isGenex = isGeneratorExpression(lib);
- const std::string nsLib =
- std::string(isNonImportedTarget && !isList(lib)
- ? "$<EXPORT_NAMESPACE>" : "") + lib;
- if (tgt || isGenex)
- {
- this->Target->AppendTLLIncludeDirectories(compileProperty(nsLib,
- "INCLUDE_DIRECTORIES", llt));
- this->Target->AppendProperty("COMPILE_DEFINITIONS",
- compileProperty(nsLib,
- "COMPILE_DEFINITIONS", llt).c_str());
- }
-
// Handle normal case first.
if(this->CurrentProcessingState != ProcessingLinkInterface)
{
@@ -331,15 +266,6 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
}
}
- this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
- generatorIface(nsLib, llt).c_str());
- this->Target->AppendProperty("INTERFACE_COMPILE_DEFINITIONS",
- compileProperty(nsLib,
- "COMPILE_DEFINITIONS", llt).c_str());
- this->Target->AppendProperty("INTERFACE_INCLUDE_DIRECTORIES",
- compileProperty(nsLib,
- "INCLUDE_DIRECTORIES", llt).c_str());
-
// Get the list of configurations considered to be DEBUG.
std::vector<std::string> const& debugConfigs =
this->Makefile->GetCMakeInstance()->GetDebugConfigs();
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 42f511e..2f650e7 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -112,7 +112,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
else
{
// Use the command name given.
- exe = ge.Parse(exe.c_str())->Evaluate(mf, config);
+ exe = ge.Parse(exe.c_str()).Evaluate(mf, config);
cmSystemTools::ConvertToUnixSlashes(exe);
}
@@ -122,7 +122,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
for(std::vector<std::string>::const_iterator ci = command.begin()+1;
ci != command.end(); ++ci)
{
- os << " " << lg->EscapeForCMake(ge.Parse(*ci)->Evaluate(mf, config));
+ os << " " << lg->EscapeForCMake(ge.Parse(*ci).Evaluate(mf, config));
}
// Finish the test command.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 1e3094c..1faa888 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -37,11 +37,11 @@ target_link_libraries(depB LINK_PRIVATE depA)
add_library(depC SHARED depC.cpp)
generate_export_header(depC)
-target_link_libraries(depC LINK_PUBLIC $<1:depA>)
+target_link_libraries(depC LINK_PUBLIC depA)
assert_property(depA LINK_INTERFACE_LIBRARIES "")
assert_property(depB LINK_INTERFACE_LIBRARIES "")
-assert_property(depC LINK_INTERFACE_LIBRARIES "$<1:depA>")
+assert_property(depC LINK_INTERFACE_LIBRARIES "depA")
add_executable(targetA targetA.cpp)
@@ -56,45 +56,3 @@ assert_property(targetA LINK_INTERFACE_LIBRARIES "")
target_link_libraries(targetA depB depC)
assert_property(targetA LINK_INTERFACE_LIBRARIES "")
-
-# cmake_policy(PUSH)
-
-cmake_policy(SET CMP0019 NEW)
-
-add_library(depD SHARED depD.cpp)
-generate_export_header(depD)
-set_property(TARGET depD APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<1:depA>)
-
-add_library(depE SHARED depE.cpp)
-generate_export_header(depE)
-target_link_libraries(depE LINK_PRIVATE depB)
-target_link_libraries(depE LINK_INTERFACE_LIBRARIES $<1:depB>)
-
-add_executable(targetB targetB.cpp)
-target_link_libraries(targetB depD depE)
-
-# cmake_policy(POP)
-
-
-macro(create_header _name)
- file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_name}")
- file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_name}/${_name}.h" "//${_name}.h\n")
-endmacro()
-
-create_header(foo)
-create_header(bar)
-
-add_library(depF SHARED depF.cpp)
-generate_export_header(depF)
-set_property(TARGET depF PROPERTY
- INTERFACE_INCLUDE_DIRECTORIES
- ${CMAKE_CURRENT_BINARY_DIR}/foo
- ${CMAKE_CURRENT_BINARY_DIR}/bar
-)
-set_property(TARGET depF PROPERTY
- INTERFACE_COMPILE_DEFINITIONS
- TEST_DEF
-)
-
-add_library(targetC targetC.cpp)
-target_link_libraries(targetC depF)
diff --git a/Tests/CMakeCommands/target_link_libraries/depD.cpp b/Tests/CMakeCommands/target_link_libraries/depD.cpp
deleted file mode 100644
index b02c76c..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depD.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#include "depD.h"
-
-int DepD::foo()
-{
- return 0;
-}
-
-DepA DepD::getA()
-{
- DepA a;
- return a;
-}
diff --git a/Tests/CMakeCommands/target_link_libraries/depD.h b/Tests/CMakeCommands/target_link_libraries/depD.h
deleted file mode 100644
index d24ff5f..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depD.h
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#include "depd_export.h"
-
-#include "depA.h"
-
-struct DEPD_EXPORT DepD
-{
- int foo();
-
- DepA getA();
-};
diff --git a/Tests/CMakeCommands/target_link_libraries/depE.cpp b/Tests/CMakeCommands/target_link_libraries/depE.cpp
deleted file mode 100644
index 1a3da4a..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depE.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#include "depE.h"
-
-int DepE::foo()
-{
- return 0;
-}
-
-DepB DepE::getB()
-{
- DepB a;
- return a;
-}
diff --git a/Tests/CMakeCommands/target_link_libraries/depE.h b/Tests/CMakeCommands/target_link_libraries/depE.h
deleted file mode 100644
index 2273e17..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depE.h
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#include "depe_export.h"
-
-#include "depB.h"
-
-struct DEPE_EXPORT DepE
-{
- int foo();
-
- DepB getB();
-};
diff --git a/Tests/CMakeCommands/target_link_libraries/depF.cpp b/Tests/CMakeCommands/target_link_libraries/depF.cpp
deleted file mode 100644
index 1fd29c4..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depF.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#include "depF.h"
-
-int DepF::foo()
-{
- return 0;
-}
diff --git a/Tests/CMakeCommands/target_link_libraries/depF.h b/Tests/CMakeCommands/target_link_libraries/depF.h
deleted file mode 100644
index 95d6b14..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depF.h
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#include "depf_export.h"
-
-struct DEPF_EXPORT DepF
-{
- int foo();
-};
diff --git a/Tests/CMakeCommands/target_link_libraries/targetB.cpp b/Tests/CMakeCommands/target_link_libraries/targetB.cpp
deleted file mode 100644
index c6a1264..0000000
--- a/Tests/CMakeCommands/target_link_libraries/targetB.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#include "depD.h"
-#include "depE.h"
-
-int main(int argc, char **argv)
-{
- DepD d;
- DepA a = d.getA();
-
- DepE e;
- DepB b = e.getB();
-
- return d.foo() + a.foo() + e.foo() + b.foo();
-}
diff --git a/Tests/CMakeCommands/target_link_libraries/targetC.cpp b/Tests/CMakeCommands/target_link_libraries/targetC.cpp
deleted file mode 100644
index ac33c67..0000000
--- a/Tests/CMakeCommands/target_link_libraries/targetC.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#include "depF.h"
-
-#include "foo.h"
-#include "bar.h"
-
-#ifndef TEST_DEF
-#error Expected TEST_DEF definition
-#endif
-
-int main(int argc, char **argv)
-{
- DepF f;
-
- return f.foo();
-}
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 66c190a..3a92d81 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 2.8.8)
project(GeneratorExpression NONE)
-add_custom_target(check-part1 ALL
+add_custom_target(check ALL
COMMAND ${CMAKE_COMMAND}
-Dtest_0=$<0:nothing>
-Dtest_0_with_comma=$<0:-Wl,--no-undefined>
@@ -57,13 +57,6 @@ add_custom_target(check-part1 ALL
-Dtest_colons_3=$<1:Qt5::Core>
-Dtest_colons_4=$<1:C:\\CMake>
-Dtest_colons_5=$<1:C:/CMake>
- -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part1.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 1 of 2)"
- VERBATIM
- )
-
-add_custom_target(check-part2 ALL
- COMMAND ${CMAKE_COMMAND}
-Dtest_incomplete_1=$<
-Dtest_incomplete_2=$<something
-Dtest_incomplete_3=$<something:
@@ -85,10 +78,7 @@ add_custom_target(check-part2 ALL
-Dtest_incomplete_19=$<1:some,thing$<ANGLE-R>
-Dtest_incomplete_20=$<CONFIGURATION$<ANGLE-R>
-Dtest_incomplete_21=$<BOOL:something$<ANGLE-R>
- -Dtest_build_interface=$<BUILD_INTERFACE:build>
- -Dtest_install_interface=$<INSTALL_INTERFACE:install>
- -Dtest_export_namespace=$<EXPORT_NAMESPACE>x
- -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part2.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 2)"
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake
+ COMMAND ${CMAKE_COMMAND} -E echo "check done"
VERBATIM
)
diff --git a/Tests/GeneratorExpression/check-common.cmake b/Tests/GeneratorExpression/check-common.cmake
deleted file mode 100644
index 8ffebd7..0000000
--- a/Tests/GeneratorExpression/check-common.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-macro(check var val)
- if(NOT "${${var}}" STREQUAL "${val}")
- message(SEND_ERROR "${var} is \"${${var}}\", not \"${val}\"")
- endif()
-endmacro()
diff --git a/Tests/GeneratorExpression/check-part1.cmake b/Tests/GeneratorExpression/check-part1.cmake
deleted file mode 100644
index 7abfa82..0000000
--- a/Tests/GeneratorExpression/check-part1.cmake
+++ /dev/null
@@ -1,56 +0,0 @@
-
-include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake)
-
-message(STATUS "config=[${config}]")
-check(test_0 "")
-check(test_0_with_comma "")
-check(test_1 "content")
-check(test_1_with_comma "-Wl,--no-undefined")
-check(test_and_0 "0")
-check(test_and_0_0 "0")
-check(test_and_0_1 "0")
-check(test_and_1 "1")
-check(test_and_1_0 "0")
-check(test_and_1_1 "1")
-check(test_and_0_invalidcontent "0")
-check(test_config_0 "0")
-check(test_config_1 "1")
-foreach(c debug release relwithdebinfo minsizerel)
- if(NOT "${test_config_${c}}" MATCHES "^(0+|1+)$")
- message(SEND_ERROR "test_config_${c} is \"${test_config_${c}}\", not all 0 or all 1")
- endif()
-endforeach()
-check(test_not_0 "1")
-check(test_not_1 "0")
-check(test_or_0 "0")
-check(test_or_0_0 "0")
-check(test_or_0_1 "1")
-check(test_or_1 "1")
-check(test_or_1_0 "1")
-check(test_or_1_1 "1")
-check(test_or_1_invalidcontent "1")
-check(test_bool_notfound "0")
-check(test_bool_foo_notfound "0")
-check(test_bool_true "1")
-check(test_bool_false "0")
-check(test_bool_on "1")
-check(test_bool_off "0")
-check(test_bool_no "0")
-check(test_bool_n "0")
-check(test_bool_empty "0")
-check(test_strequal_yes_yes "1")
-check(test_strequal_yes_yes_cs "0")
-check(test_strequal_yes_no "0")
-check(test_strequal_no_yes "0")
-check(test_strequal_angle_r "1")
-check(test_strequal_comma "1")
-check(test_strequal_angle_r_comma "0")
-check(test_strequal_both_empty "1")
-check(test_strequal_one_empty "0")
-check(test_angle_r ">")
-check(test_comma ",")
-check(test_colons_1 ":")
-check(test_colons_2 "::")
-check(test_colons_3 "Qt5::Core")
-check(test_colons_4 "C:\\\\CMake")
-check(test_colons_5 "C:/CMake")
diff --git a/Tests/GeneratorExpression/check-part2.cmake b/Tests/GeneratorExpression/check-part2.cmake
deleted file mode 100644
index 4201345..0000000
--- a/Tests/GeneratorExpression/check-part2.cmake
+++ /dev/null
@@ -1,27 +0,0 @@
-
-include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake)
-
-check(test_incomplete_1 "$<")
-check(test_incomplete_2 "$<something")
-check(test_incomplete_3 "$<something:")
-check(test_incomplete_4 "$<something:,")
-check(test_incomplete_5 "$something:,>")
-check(test_incomplete_6 "<something:,>")
-check(test_incomplete_7 "$<something::")
-check(test_incomplete_8 "$<something:,")
-check(test_incomplete_9 "$<something:,,")
-check(test_incomplete_10 "$<something:,:")
-check(test_incomplete_11 "$<something,,")
-check(test_incomplete_12 "$<,,")
-check(test_incomplete_13 "$<somespecialthing")
-check(test_incomplete_14 "$<>")
-check(test_incomplete_15 "$<some$<thing")
-check(test_incomplete_16 "$<BOOL:something")
-check(test_incomplete_17 "some$thing")
-check(test_incomplete_18 "$<1:some,thing")
-check(test_incomplete_19 "$<1:some,thing>")
-check(test_incomplete_20 "$<CONFIGURATION>")
-check(test_incomplete_21 "$<BOOL:something>")
-check(test_build_interface "build")
-check(test_install_interface "")
-check(test_export_namespace "x")
diff --git a/Tests/GeneratorExpression/check.cmake b/Tests/GeneratorExpression/check.cmake
new file mode 100644
index 0000000..af436de
--- /dev/null
+++ b/Tests/GeneratorExpression/check.cmake
@@ -0,0 +1,80 @@
+macro(check var val)
+ if(NOT "${${var}}" STREQUAL "${val}")
+ message(SEND_ERROR "${var} is \"${${var}}\", not \"${val}\"")
+ endif()
+endmacro()
+
+message(STATUS "config=[${config}]")
+check(test_0 "")
+check(test_0_with_comma "")
+check(test_1 "content")
+check(test_1_with_comma "-Wl,--no-undefined")
+check(test_and_0 "0")
+check(test_and_0_0 "0")
+check(test_and_0_1 "0")
+check(test_and_1 "1")
+check(test_and_1_0 "0")
+check(test_and_1_1 "1")
+check(test_and_0_invalidcontent "0")
+check(test_config_0 "0")
+check(test_config_1 "1")
+foreach(c debug release relwithdebinfo minsizerel)
+ if(NOT "${test_config_${c}}" MATCHES "^(0+|1+)$")
+ message(SEND_ERROR "test_config_${c} is \"${test_config_${c}}\", not all 0 or all 1")
+ endif()
+endforeach()
+check(test_not_0 "1")
+check(test_not_1 "0")
+check(test_or_0 "0")
+check(test_or_0_0 "0")
+check(test_or_0_1 "1")
+check(test_or_1 "1")
+check(test_or_1_0 "1")
+check(test_or_1_1 "1")
+check(test_or_1_invalidcontent "1")
+check(test_bool_notfound "0")
+check(test_bool_foo_notfound "0")
+check(test_bool_true "1")
+check(test_bool_false "0")
+check(test_bool_on "1")
+check(test_bool_off "0")
+check(test_bool_no "0")
+check(test_bool_n "0")
+check(test_bool_empty "0")
+check(test_strequal_yes_yes "1")
+check(test_strequal_yes_yes_cs "0")
+check(test_strequal_yes_no "0")
+check(test_strequal_no_yes "0")
+check(test_strequal_angle_r "1")
+check(test_strequal_comma "1")
+check(test_strequal_angle_r_comma "0")
+check(test_strequal_both_empty "1")
+check(test_strequal_one_empty "0")
+check(test_angle_r ">")
+check(test_comma ",")
+check(test_colons_1 ":")
+check(test_colons_2 "::")
+check(test_colons_3 "Qt5::Core")
+check(test_colons_4 "C:\\\\CMake")
+check(test_colons_5 "C:/CMake")
+check(test_incomplete_1 "$<")
+check(test_incomplete_2 "$<something")
+check(test_incomplete_3 "$<something:")
+check(test_incomplete_4 "$<something:,")
+check(test_incomplete_5 "$something:,>")
+check(test_incomplete_6 "<something:,>")
+check(test_incomplete_7 "$<something::")
+check(test_incomplete_8 "$<something:,")
+check(test_incomplete_9 "$<something:,,")
+check(test_incomplete_10 "$<something:,:")
+check(test_incomplete_11 "$<something,,")
+check(test_incomplete_12 "$<,,")
+check(test_incomplete_13 "$<somespecialthing")
+check(test_incomplete_14 "$<>")
+check(test_incomplete_15 "$<some$<thing")
+check(test_incomplete_16 "$<BOOL:something")
+check(test_incomplete_17 "some$thing")
+check(test_incomplete_18 "$<1:some,thing")
+check(test_incomplete_19 "$<1:some,thing>")
+check(test_incomplete_20 "$<CONFIGURATION>")
+check(test_incomplete_21 "$<BOOL:something>")
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
index 2a0d1a8..7cb1b42 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -45,23 +45,3 @@ set_property(TARGET TargetIncludeDirectories
APPEND PROPERTY INCLUDE_DIRECTORIES
"$<TARGET_PROPERTY:somelib::withcolons,INTERFACE_INCLUDE_DIRECTORIES>"
)
-
-create_header(fee)
-create_header(fiy)
-create_header(foh)
-create_header(fum)
-
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib1.cpp" "#include \"fee.h\"\n")
-add_library(lib1 "${CMAKE_CURRENT_BINARY_DIR}/lib1.cpp")
-set_property(TARGET lib1 APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/fee")
-set_property(TARGET lib1 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/fiy")
-set_property(TARGET lib1 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CMAKE_CURRENT_BINARY_DIR}/foh>")
-
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib2.cpp" "#include \"fiy.h\"\n")
-add_library(lib2 "${CMAKE_CURRENT_BINARY_DIR}/lib2.cpp")
-set_property(TARGET lib2 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/fum;$<TARGET_PROPERTY:lib1,INTERFACE_INCLUDE_DIRECTORIES>")
-set_property(TARGET lib2 APPEND PROPERTY INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:lib1,INTERFACE_INCLUDE_DIRECTORIES>")
-
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main3.cpp" "#include \"fiy.h\"\n#include \"foh.h\"\n#include \"fum.h\"\nint main(int,char**) { return 0; }\n")
-add_executable(exe3 "${CMAKE_CURRENT_BINARY_DIR}/main3.cpp")
-set_property(TARGET exe3 APPEND PROPERTY INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:lib2,INTERFACE_INCLUDE_DIRECTORIES>")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d6c52dc467aa9e9d76e94390fa0c829e09704e7f
commit d6c52dc467aa9e9d76e94390fa0c829e09704e7f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 30 10:45:21 2012 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Nov 30 10:45:36 2012 -0500
Revert topic 'link-libraries-generator-expression'
Revert commits:
1935ad83 Workaround the failing build on SunPro.
9e0921b0 Make targets depend on the (config-specific) union of dependencies.
5404c6f4 Generate the frameworks linked by a target lazily.
b4ab0c15 Add cmTarget::GetDirectLinkDependencies.
ed9f5b57 Add includes and compile definitions with target_link_libraries.
82f77804 Add the TARGET_DEFINED generator expression
c61ed6d5 Handle INTERFACE properties transitively for includes and defines.
7130be0b Keep track of INCLUDE_DIRECTORIES as a vector of structs.
e0575c47 Use cmsys::auto_ptr to manage cmCompiledGeneratorExpressions
8f77e068 Genex: Add INTERFACE_LINK_LIBRARIES property
9737cec6 Add expressions for separating build-location from install-location.
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 2acbfff..ab77c6b 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -200,44 +200,20 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
// Get the depender.
cmTarget* depender = this->Targets[depender_index];
- // Loop over all targets linked directly in all configs.
- // We need to make targets depend on the union of all config-specific
- // dependencies in all targets, because the generated build-systems can't
- // deal with config-specific dependencies.
+ // Loop over all targets linked directly.
{
- std::vector<std::string> configs;
- depender->GetMakefile()->GetConfigurations(configs);
+ cmTarget::LinkLibraryVectorType const& tlibs =
+ depender->GetOriginalLinkLibraries();
std::set<cmStdString> emitted;
- {
- std::vector<std::string> tlibs;
- depender->GetDirectLinkLibraries(0, tlibs);
// A target should not depend on itself.
emitted.insert(depender->GetName());
- for(std::vector<std::string>::const_iterator lib = tlibs.begin();
+ for(cmTarget::LinkLibraryVectorType::const_iterator lib = tlibs.begin();
lib != tlibs.end(); ++lib)
{
// Don't emit the same library twice for this target.
- if(emitted.insert(*lib).second)
- {
- this->AddTargetDepend(depender_index, lib->c_str(), true);
- }
- }
- }
- for (std::vector<std::string>::const_iterator it = configs.begin();
- it != configs.end(); ++it)
- {
- std::vector<std::string> tlibs;
- depender->GetDirectLinkLibraries(it->c_str(), tlibs);
- // A target should not depend on itself.
- emitted.insert(depender->GetName());
- for(std::vector<std::string>::const_iterator lib = tlibs.begin();
- lib != tlibs.end(); ++lib)
+ if(emitted.insert(lib->first).second)
{
- // Don't emit the same library twice for this target.
- if(emitted.insert(*lib).second)
- {
- this->AddTargetDepend(depender_index, lib->c_str(), true);
- }
+ this->AddTargetDepend(depender_index, lib->first.c_str(), true);
}
}
}
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index f2f77ee..07df7d5 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -47,7 +47,7 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
{
return target->GetLocation(this->Config);
}
- return this->GE->Parse(argv0)->Evaluate(this->Makefile, this->Config);
+ return this->GE->Parse(argv0).Evaluate(this->Makefile, this->Config);
}
//----------------------------------------------------------------------------
@@ -58,7 +58,7 @@ cmCustomCommandGenerator
cmCustomCommandLine const& commandLine = this->CC.GetCommandLines()[c];
for(unsigned int j=1;j < commandLine.size(); ++j)
{
- std::string arg = this->GE->Parse(commandLine[j])->Evaluate(this->Makefile,
+ std::string arg = this->GE->Parse(commandLine[j]).Evaluate(this->Makefile,
this->Config);
cmd += " ";
if(this->OldStyle)
diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h
index 4866f0d..445fd0e 100644
--- a/Source/cmDocumentGeneratorExpressions.h
+++ b/Source/cmDocumentGeneratorExpressions.h
@@ -27,7 +27,6 @@
" $<COMMA> = A literal ','. Used to compare " \
"strings which contain a ',' for example.\n" \
" $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)\n" \
- " $<TARGET_DEFINED:tgt> = '1' if tgt is a target, else '0'\n" \
" $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n" \
" $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)\n" \
"where \"tgt\" is the name of a target. " \
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index c67486a..fb3f39f 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -12,7 +12,6 @@
#include "cmExportBuildFileGenerator.h"
#include "cmExportCommand.h"
-#include "cmGeneratorExpression.h"
//----------------------------------------------------------------------------
cmExportBuildFileGenerator::cmExportBuildFileGenerator()
@@ -32,23 +31,6 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
if(this->ExportedTargets.insert(te).second)
{
this->GenerateImportTargetCode(os, te);
-
- ImportPropertyMap properties;
-
- if ((*tei)->GetPolicyStatusCMP0019() == cmPolicies::NEW)
- {
- this->PopulateInterfaceProperty("INTERFACE_LINK_LIBRARIES", te,
- cmGeneratorExpression::BuildInterface,
- properties);
- }
- this->PopulateInterfaceProperty("INTERFACE_INCLUDE_DIRECTORIES", te,
- cmGeneratorExpression::BuildInterface,
- properties);
- this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", te,
- cmGeneratorExpression::BuildInterface,
- properties);
-
- this->GenerateInterfaceProperties(te, os, properties);
}
else
{
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index a67c3ee..8dffae4 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -125,50 +125,6 @@ void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
}
//----------------------------------------------------------------------------
-void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
- cmTarget *target,
- cmGeneratorExpression::PreprocessContext preprocessRule,
- ImportPropertyMap &properties)
-{
- const char *input = target->GetProperty(propName);
- if (input)
- {
- if (!*input)
- {
- // Set to empty
- properties[propName] = "";
- return;
- }
- std::string prepro = cmGeneratorExpression::Preprocess(input,
- preprocessRule,
- this->Namespace.c_str());
- if (!prepro.empty())
- {
- properties[propName] = prepro;
- }
- }
-}
-
-//----------------------------------------------------------------------------
-void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget *target,
- std::ostream& os,
- const ImportPropertyMap &properties)
-{
- if (!properties.empty())
- {
- std::string targetName = this->Namespace;
- targetName += target->GetName();
- os << "SET_TARGET_PROPERTIES(" << targetName << " PROPERTIES\n";
- for(ImportPropertyMap::const_iterator pi = properties.begin();
- pi != properties.end(); ++pi)
- {
- os << " " << pi->first << " \"" << pi->second << "\"\n";
- }
- os << ")\n\n";
- }
-}
-
-//----------------------------------------------------------------------------
void
cmExportFileGenerator
::SetImportDetailProperties(const char* config, std::string const& suffix,
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 3aee1b8..70bc65d 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -13,7 +13,6 @@
#define cmExportFileGenerator_h
#include "cmCommand.h"
-#include "cmGeneratorExpression.h"
/** \class cmExportFileGenerator
* \brief Generate a file exporting targets from a build or install tree.
@@ -92,12 +91,6 @@ protected:
cmMakefile* mf,
cmTarget* depender,
cmTarget* dependee) = 0;
- void PopulateInterfaceProperty(const char *,
- cmTarget *target,
- cmGeneratorExpression::PreprocessContext,
- ImportPropertyMap &properties);
- void GenerateInterfaceProperties(cmTarget *target, std::ostream& os,
- const ImportPropertyMap &properties);
// The namespace in which the exports are placed in the generated file.
std::string Namespace;
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index c22abf4..7841731 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -19,7 +19,6 @@
#include "cmInstallExportGenerator.h"
#include "cmInstallTargetGenerator.h"
#include "cmTargetExport.h"
-#include "cmGeneratorExpression.h"
//----------------------------------------------------------------------------
cmExportInstallFileGenerator
@@ -49,26 +48,6 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
if(this->ExportedTargets.insert(te->Target).second)
{
this->GenerateImportTargetCode(os, te->Target);
-
- ImportPropertyMap properties;
-
- if ((*tei)->Target->GetPolicyStatusCMP0019() == cmPolicies::NEW)
- {
- this->PopulateInterfaceProperty("INTERFACE_LINK_LIBRARIES",
- te->Target,
- cmGeneratorExpression::InstallInterface,
- properties);
- }
- this->PopulateInterfaceProperty("INTERFACE_INCLUDE_DIRECTORIES",
- te->Target,
- cmGeneratorExpression::InstallInterface,
- properties);
- this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS",
- te->Target,
- cmGeneratorExpression::InstallInterface,
- properties);
-
- this->GenerateInterfaceProperties(te->Target, os, properties);
}
else
{
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 97a0581..32bf941 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -25,29 +25,44 @@
//----------------------------------------------------------------------------
cmGeneratorExpression::cmGeneratorExpression(
cmListFileBacktrace const& backtrace):
- Backtrace(backtrace)
+ Backtrace(backtrace), CompiledExpression(0)
{
}
//----------------------------------------------------------------------------
-cmsys::auto_ptr<cmCompiledGeneratorExpression>
+const cmCompiledGeneratorExpression &
cmGeneratorExpression::Parse(std::string const& input)
{
return this->Parse(input.c_str());
}
//----------------------------------------------------------------------------
-cmsys::auto_ptr<cmCompiledGeneratorExpression>
+const cmCompiledGeneratorExpression &
cmGeneratorExpression::Parse(const char* input)
{
- return cmsys::auto_ptr<cmCompiledGeneratorExpression>(
- new cmCompiledGeneratorExpression(
- this->Backtrace,
- input));
+ cmGeneratorExpressionLexer l;
+ std::vector<cmGeneratorExpressionToken> tokens = l.Tokenize(input);
+ bool needsParsing = l.GetSawGeneratorExpression();
+ std::vector<cmGeneratorExpressionEvaluator*> evaluators;
+
+ if (needsParsing)
+ {
+ cmGeneratorExpressionParser p(tokens);
+ p.Parse(evaluators);
+ }
+
+ delete this->CompiledExpression;
+ this->CompiledExpression = new cmCompiledGeneratorExpression(
+ this->Backtrace,
+ evaluators,
+ input,
+ needsParsing);
+ return *this->CompiledExpression;
}
cmGeneratorExpression::~cmGeneratorExpression()
{
+ delete this->CompiledExpression;
}
//----------------------------------------------------------------------------
@@ -58,7 +73,7 @@ const char *cmCompiledGeneratorExpression::Evaluate(
{
if (!this->NeedsParsing)
{
- return this->Input.c_str();
+ return this->Input;
}
this->Output = "";
@@ -93,19 +108,12 @@ const char *cmCompiledGeneratorExpression::Evaluate(
cmCompiledGeneratorExpression::cmCompiledGeneratorExpression(
cmListFileBacktrace const& backtrace,
- const char *input)
- : Backtrace(backtrace), Input(input ? input : "")
+ const std::vector<cmGeneratorExpressionEvaluator*> &evaluators,
+ const char *input, bool needsParsing)
+ : Backtrace(backtrace), Evaluators(evaluators), Input(input),
+ NeedsParsing(needsParsing)
{
- cmGeneratorExpressionLexer l;
- std::vector<cmGeneratorExpressionToken> tokens =
- l.Tokenize(this->Input.c_str());
- this->NeedsParsing = l.GetSawGeneratorExpression();
- if (this->NeedsParsing)
- {
- cmGeneratorExpressionParser p(tokens);
- p.Parse(this->Evaluators);
- }
}
@@ -123,9 +131,15 @@ cmCompiledGeneratorExpression::~cmCompiledGeneratorExpression()
}
}
-//----------------------------------------------------------------------------
-static std::string stripAllGeneratorExpressions(const std::string &input)
+std::string cmGeneratorExpression::Preprocess(const std::string &input,
+ PreprocessContext context)
{
+ if (context != StripAllGeneratorExpressions)
+ {
+ assert(!"cmGeneratorExpression::Preprocess called with invalid args");
+ return std::string();
+ }
+
std::string result;
std::string::size_type pos = 0;
std::string::size_type lastPos = pos;
@@ -164,95 +178,3 @@ static std::string stripAllGeneratorExpressions(const std::string &input)
result += input.substr(lastPos);
return result;
}
-
-//----------------------------------------------------------------------------
-static std::string stripExportInterface(const std::string &input,
- cmGeneratorExpression::PreprocessContext context,
- const char *ns)
-{
- std::string result;
- {
- std::string::size_type pos = 0;
- std::string::size_type lastPos = pos;
- while((pos = input.find("$<BUILD_INTERFACE:", lastPos)) != input.npos
- || (pos = input.find("$<INSTALL_INTERFACE:", lastPos)) != input.npos)
- {
- result += input.substr(lastPos, pos - lastPos);
- const bool gotInstallInterface = input[pos + 2] == 'I';
- pos += gotInstallInterface ? sizeof("$<INSTALL_INTERFACE:") - 1
- : sizeof("$<BUILD_INTERFACE:") - 1;
- int nestingLevel = 1;
- const char *c = input.c_str() + pos;
- const char * const cStart = c;
- for ( ; *c; ++c)
- {
- if(c[0] == '$' && c[1] == '<')
- {
- ++nestingLevel;
- ++c;
- continue;
- }
- if(c[0] == '>')
- {
- --nestingLevel;
- if (nestingLevel != 0)
- {
- continue;
- }
- if(context == cmGeneratorExpression::BuildInterface
- && !gotInstallInterface)
- {
- result += input.substr(pos, c - cStart);
- }
- else if(context == cmGeneratorExpression::InstallInterface
- && gotInstallInterface)
- {
- result += input.substr(pos, c - cStart);
- }
- break;
- }
- }
- const std::string::size_type traversed = (c - cStart) + 1;
- if (!*c)
- {
- result += std::string(gotInstallInterface ? "$<INSTALL_INTERFACE:"
- : "$<BUILD_INTERFACE:")
- + input.substr(pos, traversed);
- }
- pos += traversed;
- lastPos = pos;
- }
- result += input.substr(lastPos);
- }
-
- {
- std::string::size_type pos = 0;
- std::string::size_type lastPos = pos;
-
- std::string expNs = ns ? ns : "";
- while((pos = result.find("$<EXPORT_NAMESPACE>", lastPos)) != input.npos)
- {
- result.replace(pos, sizeof("$<EXPORT_NAMESPACE>") - 1, expNs);
- pos += sizeof("$<EXPORT_NAMESPACE>") - 1;
- }
- }
- return result;
-}
-
-//----------------------------------------------------------------------------
-std::string cmGeneratorExpression::Preprocess(const std::string &input,
- PreprocessContext context,
- const char *ns)
-{
- if (context == StripAllGeneratorExpressions)
- {
- return stripAllGeneratorExpressions(input);
- }
- else if (context == BuildInterface || context == InstallInterface)
- {
- return stripExportInterface(input, context, ns);
- }
-
- assert(!"cmGeneratorExpression::Preprocess called with invalid args");
- return std::string();
-}
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index c3daf84..ea3e7d0 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -14,12 +14,10 @@
#define cmGeneratorExpression_h
#include "cmStandardIncludes.h"
-#include "cmListFileCache.h"
#include <stack>
#include <cmsys/RegularExpression.hxx>
-#include <cmsys/auto_ptr.hxx>
class cmTarget;
class cmMakefile;
@@ -46,25 +44,22 @@ public:
cmGeneratorExpression(cmListFileBacktrace const& backtrace);
~cmGeneratorExpression();
- cmsys::auto_ptr<cmCompiledGeneratorExpression> Parse(
- std::string const& input);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> Parse(const char* input);
+ const cmCompiledGeneratorExpression& Parse(std::string const& input);
+ const cmCompiledGeneratorExpression& Parse(const char* input);
enum PreprocessContext {
- StripAllGeneratorExpressions,
- BuildInterface,
- InstallInterface
+ StripAllGeneratorExpressions
};
static std::string Preprocess(const std::string &input,
- PreprocessContext context,
- const char *ns = 0);
+ PreprocessContext context);
private:
cmGeneratorExpression(const cmGeneratorExpression &);
void operator=(const cmGeneratorExpression &);
cmListFileBacktrace const& Backtrace;
+ cmCompiledGeneratorExpression *CompiledExpression;
};
class cmCompiledGeneratorExpression
@@ -81,24 +76,20 @@ public:
~cmCompiledGeneratorExpression();
- std::string GetInput() const
- {
- return this->Input;
- }
-
private:
cmCompiledGeneratorExpression(cmListFileBacktrace const& backtrace,
- const char *input);
+ const std::vector<cmGeneratorExpressionEvaluator*> &evaluators,
+ const char *input, bool needsParsing);
friend class cmGeneratorExpression;
cmCompiledGeneratorExpression(const cmCompiledGeneratorExpression &);
void operator=(const cmCompiledGeneratorExpression &);
- cmListFileBacktrace Backtrace;
- std::vector<cmGeneratorExpressionEvaluator*> Evaluators;
- const std::string Input;
- bool NeedsParsing;
+ cmListFileBacktrace const& Backtrace;
+ const std::vector<cmGeneratorExpressionEvaluator*> Evaluators;
+ const char* const Input;
+ const bool NeedsParsing;
mutable std::set<cmTarget*> Targets;
mutable std::string Output;
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 9c6ea23..c609000 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -94,31 +94,6 @@ static const struct OneNode : public cmGeneratorExpressionNode
} oneNode;
//----------------------------------------------------------------------------
-static const struct OneNode buildInterfaceNode;
-
-//----------------------------------------------------------------------------
-static const struct ZeroNode installInterfaceNode;
-
-//----------------------------------------------------------------------------
-static const struct NullNode : public cmGeneratorExpressionNode
-{
- NullNode() {}
-
- virtual bool GeneratesContent() const { return false; }
-
- std::string Evaluate(const std::vector<std::string> &,
- cmGeneratorExpressionContext *,
- const GeneratorExpressionContent *,
- cmGeneratorExpressionDAGChecker *) const
- {
- return std::string();
- }
-
- virtual int NumExpectedParameters() const { return 0; }
-
-} nullNode;
-
-//----------------------------------------------------------------------------
#define BOOLEAN_OP_NODE(OPNAME, OP, SUCCESS_VALUE, FAILURE_VALUE) \
static const struct OP ## Node : public cmGeneratorExpressionNode \
{ \
@@ -286,29 +261,6 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
} configurationTestNode;
//----------------------------------------------------------------------------
-static const struct TargetTestNode : public cmGeneratorExpressionNode
-{
- TargetTestNode() {}
-
- virtual int NumExpectedParameters() const { return 1; }
-
- std::string Evaluate(const std::vector<std::string> ¶meters,
- cmGeneratorExpressionContext *context,
- const GeneratorExpressionContent *,
- cmGeneratorExpressionDAGChecker *) const
- {
- return context->Makefile->FindTargetToUse(parameters.front().c_str())
- ? "1" : "0";
- }
-} targetTestNode;
-
-//----------------------------------------------------------------------------
-static const char* targetPropertyTransitiveWhitelist[] = {
- "INTERFACE_INCLUDE_DIRECTORIES"
- , "INTERFACE_COMPILE_DEFINITIONS"
-};
-
-//----------------------------------------------------------------------------
static const struct TargetPropertyNode : public cmGeneratorExpressionNode
{
TargetPropertyNode() {}
@@ -410,27 +362,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
const char *prop = target->GetProperty(propertyName.c_str());
- if (!prop)
- {
- return std::string();
- }
-
- for (size_t i = 0;
- i < (sizeof(targetPropertyTransitiveWhitelist) /
- sizeof(*targetPropertyTransitiveWhitelist));
- ++i)
- {
- if (targetPropertyTransitiveWhitelist[i] == propertyName)
- {
- cmGeneratorExpression ge(context->Backtrace);
- return ge.Parse(prop)->Evaluate(context->Makefile,
- context->Config,
- context->Quiet,
- context->Target,
- &dagChecker);
- }
- }
- return prop;
+ return prop ? prop : "";
}
} targetPropertyNode;
@@ -659,14 +591,6 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
return &commaNode;
else if (identifier == "TARGET_PROPERTY")
return &targetPropertyNode;
- else if (identifier == "BUILD_INTERFACE")
- return &buildInterfaceNode;
- else if (identifier == "INSTALL_INTERFACE")
- return &installInterfaceNode;
- else if (identifier == "EXPORT_NAMESPACE")
- return &nullNode;
- else if (identifier == "TARGET_DEFINED")
- return &targetTestNode;
return 0;
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 62ee26a..de8b5e3 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -252,7 +252,45 @@ const char* cmGeneratorTarget::GetCreateRuleVariable()
std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
const char *config)
{
- return this->Target->GetIncludeDirectories(config);
+ std::vector<std::string> includes;
+ const char *prop = this->Target->GetProperty("INCLUDE_DIRECTORIES");
+ if(!prop)
+ {
+ return includes;
+ }
+
+ cmListFileBacktrace lfbt;
+ cmGeneratorExpression ge(lfbt);
+
+ cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ this->GetName(),
+ "INCLUDE_DIRECTORIES", 0, 0);
+
+ cmSystemTools::ExpandListArgument(ge.Parse(prop)
+ .Evaluate(this->Makefile,
+ config,
+ false,
+ this->Target,
+ &dagChecker),
+ includes);
+
+ std::set<std::string> uniqueIncludes;
+ std::vector<std::string> orderedAndUniqueIncludes;
+ for(std::vector<std::string>::const_iterator
+ li = includes.begin(); li != includes.end(); ++li)
+ {
+ std::string inc = *li;
+ if (!cmSystemTools::IsOff(inc.c_str()))
+ {
+ cmSystemTools::ConvertToUnixSlashes(inc);
+ }
+ if(uniqueIncludes.insert(inc).second)
+ {
+ orderedAndUniqueIncludes.push_back(inc);
+ }
+ }
+
+ return orderedAndUniqueIncludes;
}
//----------------------------------------------------------------------------
@@ -277,7 +315,7 @@ std::string cmGeneratorTarget::GetCompileDefinitions(const char *config)
cmGeneratorExpressionDAGChecker dagChecker(lfbt,
this->GetName(),
defPropName, 0, 0);
- return ge.Parse(prop)->Evaluate(this->Makefile,
+ return ge.Parse(prop).Evaluate(this->Makefile,
config,
false,
this->Target,
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index d9b586e..9bbeeaf 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1997,8 +1997,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
dirs.Add(incpath.c_str());
}
}
- std::vector<std::string> frameworks;
- target.GetFrameworks(configName, frameworks);
+ std::vector<std::string>& frameworks = target.GetFrameworks();
if(frameworks.size())
{
for(std::vector<std::string>::iterator fmIt = frameworks.begin();
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 5fa10f2..8498d72 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1665,14 +1665,8 @@ void cmMakefile::AddIncludeDirectory(const char* inc, bool before)
l != this->Targets.end(); ++l)
{
cmTarget &t = l->second;
- if (before)
- {
- t.PrependTLLIncludeDirectories(inc);
- }
- else
- {
- t.AppendTLLIncludeDirectories(inc);
- }
+ prop = t.GetProperties().GetOrCreateProperty("INCLUDE_DIRECTORIES");
+ AddStringToProperty(prop, "INCLUDE_DIRECTORIES", inc, before);
}
}
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index f46edf3..2b89c79 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1565,8 +1565,7 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags()
}
std::string flags;
- std::vector<std::string> frameworks;
- this->Target->GetFrameworks(config, frameworks);
+ std::vector<std::string>& frameworks = this->Target->GetFrameworks();
for(i = frameworks.begin();
i != frameworks.end(); ++i)
{
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 13e36c8..6aef502 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -491,43 +491,6 @@ cmPolicies::cmPolicies()
"CMAKE_SHARED_LIBRARY_<Lang>_FLAGS whether it is modified or not and "
"honor the POSITION_INDEPENDENT_CODE target property.",
2,8,9,0, cmPolicies::WARN);
-
- this->DefinePolicy(
- CMP0019, "CMP0019",
- "Use INTERFACE_LINK_LIBRARIES instead of LINK_INTERFACE_LIBRARIES.",
- "CMake 2.8.10 used the (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? "
- "properties to determine the link interface. CMake 2.8.11 and higher "
- "prefer instead to use the INTERFACE_LINK_LIBRARIES target property to "
- "determine the link interface, while ignoring "
- "(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? completely. The new "
- "INTERFACE_LINK_LIBRARIES target property can use generator expressions "
- "to specify config-specific link libraries."
- "\n"
- "The OLD behavior for this policy is to ignore the "
- "INTERFACE_LINK_LIBRARIES property for all targets and use the "
- "value of (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? instead."
- "\n"
- "The NEW behavior for this policy is to ignore "
- "the value of the (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? target "
- "property",
- 2,8,11,0, cmPolicies::WARN);
-
- this->DefinePolicy(
- CMP0020, "CMP0020",
- "Use INCLUDE_DIRECTORIES order implied by target_link_libraries.",
- "CMake 2.8.11 introduced a feature where using target_link_libraries "
- "can read the INTERFACE_INCLUDE_DIRECTORIES property of a target and "
- "use the value as include directories when compiling. Because the "
- "target_link_libraries call might occur before the include_directories "
- "call, this could change the order of includes in the compile step."
- "\n"
- "The OLD behavior for this policy is to let the include_directories call "
- "determine the order of includes."
- "\n"
- "The NEW behavior for this policy is to use the order of includes "
- "determined by the order of all calls to target_link_libraries and "
- "include_directories",
- 2,8,11,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 94154ee..6932565 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -68,8 +68,6 @@ public:
CMP0018, ///< Ignore language flags for shared libs, and adhere to
/// POSITION_INDEPENDENT_CODE property and *_COMPILE_OPTIONS_PI{E,C}
/// instead.
- CMP0019, ///< Use new-style INTERFACE_LINK_LIBRARIES
- CMP0020, ///< Use INCLUDE_DIRECTORIES order from target_link_libraries
/** \brief Always the last entry.
*
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3fce0d7..be20464 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -21,7 +21,6 @@
#include "cmDocumentLocationUndefined.h"
#include "cmListFileCache.h"
#include "cmGeneratorExpression.h"
-#include "cmGeneratorExpressionDAGChecker.h"
#include <cmsys/RegularExpression.hxx>
#include <map>
#include <set>
@@ -119,18 +118,6 @@ public:
struct SourceEntry { std::vector<cmSourceFile*> Depends; };
typedef std::map<cmSourceFile*, SourceEntry> SourceEntriesType;
SourceEntriesType SourceEntries;
-
- struct IncludeDirectoriesEntry {
- IncludeDirectoriesEntry(
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge,
- bool tllEntry = false)
- : ge(cge), ImpliedByTargetLinkLibraries(tllEntry)
- {}
- const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
- const bool ImpliedByTargetLinkLibraries;
- };
- std::vector<IncludeDirectoriesEntry*> IncludeDirectoriesEntries;
- std::string IncludeDirectoriesString;
};
//----------------------------------------------------------------------------
@@ -140,7 +127,6 @@ cmTarget::cmTarget()
this->PolicyStatusCMP0003 = cmPolicies::WARN;
this->PolicyStatusCMP0004 = cmPolicies::WARN;
this->PolicyStatusCMP0008 = cmPolicies::WARN;
- this->PolicyStatusCMP0019 = cmPolicies::WARN;
this->LinkLibrariesAnalyzed = false;
this->HaveInstallRule = false;
this->DLLPlatform = false;
@@ -1423,8 +1409,6 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->Makefile->GetPolicyStatus(cmPolicies::CMP0004);
this->PolicyStatusCMP0008 =
this->Makefile->GetPolicyStatus(cmPolicies::CMP0008);
- this->PolicyStatusCMP0019 =
- this->Makefile->GetPolicyStatus(cmPolicies::CMP0019);
}
//----------------------------------------------------------------------------
@@ -1744,10 +1728,9 @@ cmTargetTraceDependencies
for(cmCustomCommandLine::const_iterator cli = cit->begin();
cli != cit->end(); ++cli)
{
- const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge
- = ge.Parse(*cli);
- cge->Evaluate(this->Makefile, 0, true);
- std::set<cmTarget*> geTargets = cge->GetTargets();
+ const cmCompiledGeneratorExpression &cge = ge.Parse(*cli);
+ cge.Evaluate(this->Makefile, 0, true);
+ std::set<cmTarget*> geTargets = cge.GetTargets();
for(std::set<cmTarget*>::const_iterator it = geTargets.begin();
it != geTargets.end(); ++it)
{
@@ -2110,69 +2093,23 @@ bool cmTarget::NameResolvesToFramework(const std::string& libname)
}
//----------------------------------------------------------------------------
-void cmTarget::GetFrameworks(const char *config,
- std::vector<std::string> &frameworks)
+bool cmTarget::AddFramework(const std::string& libname, LinkLibraryType)
{
- std::vector<std::string> llibs;
- this->GetDirectLinkLibraries(config, llibs);
- for(std::vector<std::string>::const_iterator li = llibs.begin();
- li != llibs.end(); ++li)
+ if(this->NameResolvesToFramework(libname.c_str()))
{
- if(this->NameResolvesToFramework(li->c_str()))
+ std::string frameworkDir = libname;
+ frameworkDir += "/../";
+ frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str());
+ std::vector<std::string>::iterator i =
+ std::find(this->Frameworks.begin(),
+ this->Frameworks.end(), frameworkDir);
+ if(i == this->Frameworks.end())
{
- std::string frameworkDir = *li + "/../";
- frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str());
- std::vector<std::string>::iterator i =
- std::find(frameworks.begin(),
- frameworks.end(), frameworkDir);
- if(i == frameworks.end())
- {
- frameworks.push_back(frameworkDir);
- }
+ this->Frameworks.push_back(frameworkDir);
}
+ return true;
}
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::GetDirectLinkLibraries(const char *config,
- std::vector<std::string> &libs) const
-{
- const char *prop = const_cast<cmTarget*>(this)
- ->GetProperty("LINK_LIBRARIES");
- if (prop)
- {
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
-
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "LINK_LIBRARIES", 0, 0);
- cmSystemTools::ExpandListArgument(ge.Parse(prop)->Evaluate(this->Makefile,
- config,
- false,
- const_cast<cmTarget*>(this),
- &dagChecker),
- libs);
- }
-}
-
-//----------------------------------------------------------------------------
-static std::string generatorIface(const std::string &value,
- cmTarget::LinkLibraryType llt)
-{
- if (llt == cmTarget::DEBUG)
- {
- return "$<$<CONFIG:Debug>:"
- + value
- + ">";
- }
- else if (llt == cmTarget::OPTIMIZED)
- {
- return "$<$<NOT:$<CONFIG:Debug>>:"
- + value
- + ">";
- }
- return value;
+ return false;
}
//----------------------------------------------------------------------------
@@ -2185,21 +2122,9 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
{
return;
}
-
- this->AppendProperty("LINK_LIBRARIES",
- generatorIface(lib, llt).c_str());
-
- std::string pplib = cmGeneratorExpression::Preprocess(
- lib,
- cmGeneratorExpression::StripAllGeneratorExpressions);
-
- if (pplib.empty())
- {
- return;
- }
-
+ this->AddFramework(lib, llt);
cmTarget::LibraryID tmp;
- tmp.first = pplib;
+ tmp.first = lib;
tmp.second = llt;
this->LinkLibraries.push_back( tmp );
this->OriginalLinkLibraries.push_back(tmp);
@@ -2236,7 +2161,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
break;
}
dependencies += ";";
- dependencies += pplib;
+ dependencies += lib;
dependencies += ";";
mf.AddCacheDefinition( targetEntry.c_str(), dependencies.c_str(),
"Dependencies for the target",
@@ -2541,20 +2466,6 @@ void cmTarget::GatherDependencies( const cmMakefile& mf,
}
//----------------------------------------------------------------------------
-void deleteAndClear(
- std::vector<cmTargetInternals::IncludeDirectoriesEntry*> &entries)
-{
- for (std::vector<cmTargetInternals::IncludeDirectoriesEntry*>::const_iterator
- it = entries.begin(),
- end = entries.end();
- it != end; ++it)
- {
- delete *it;
- }
- entries.clear();
-}
-
-//----------------------------------------------------------------------------
void cmTarget::SetProperty(const char* prop, const char* value)
{
if (!prop)
@@ -2562,16 +2473,6 @@ void cmTarget::SetProperty(const char* prop, const char* value)
return;
}
- if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
- {
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
- deleteAndClear(this->Internal->IncludeDirectoriesEntries);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
- this->Internal->IncludeDirectoriesEntries.push_back(
- new cmTargetInternals::IncludeDirectoriesEntry(cge));
- return;
- }
this->Properties.SetProperty(prop, value, cmProperty::TARGET);
this->MaybeInvalidatePropertyCache(prop);
}
@@ -2584,159 +2485,11 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
{
return;
}
- if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
- {
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
- this->Internal->IncludeDirectoriesEntries.push_back(
- new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(value)));
- return;
- }
this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString);
this->MaybeInvalidatePropertyCache(prop);
}
//----------------------------------------------------------------------------
-void cmTarget::AppendTLLIncludeDirectories(const std::string &includes)
-{
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
- this->Internal->IncludeDirectoriesEntries.push_back(
- new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(includes),
- true)
- );
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::PrependTLLIncludeDirectories(const std::string &includes)
-{
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
- this->Internal->IncludeDirectoriesEntries.insert(
- this->Internal->IncludeDirectoriesEntries.begin(),
- new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(includes),
- true)
- );
-}
-
-#if defined(__SUNPRO_CC) && __SUNPRO_CC <= 0x510
-// The Sun Machine on the dashboard has an un diagnosed error with parsing
-// this template: http://open.cdash.org/viewBuildError.php?buildid=2689581
-// In the absense of an ability to find out what the problem is, just
-// write the specialized expansion of the template instead. If cmStdRemove
-// is ever to move to a generic location, that problem would have to be
-// fixed.
-std::vector<std::string>::iterator cmStdRemove(
- std::vector<std::string>::iterator first,
- std::vector<std::string>::iterator last,
- const std::string& value)
-#else
-// A Borland machine on the dashboard has a faulty std::remove.
-template <typename ForwardIterator, typename T>
-ForwardIterator cmStdRemove(ForwardIterator first,
- ForwardIterator last,
- const T& value)
-#endif
-{
-#if defined(__BORLANDC__) || (defined(__GNUC__) && __GNUC__ < 3) \
- || (defined(__SUNPRO_CC) && __SUNPRO_CC <= 0x510)
-# if defined(__SUNPRO_CC) && __SUNPRO_CC <= 0x510
- std::vector<std::string>::iterator result = first;
-# else
- ForwardIterator result = first;
-# endif
- for ( ; first != last; ++first)
- {
- if (!(*first == value))
- {
- *result++ = *first;
- }
- }
- return result;
-#else
- return std::remove<ForwardIterator, T>(first, last, value);
-#endif
-}
-
-//----------------------------------------------------------------------------
-std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
-{
- std::set<std::string> fromTll;
- std::vector<std::string> includes;
- std::set<std::string> uniqueIncludes;
- cmListFileBacktrace lfbt;
-
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "INCLUDE_DIRECTORIES", 0, 0);
-
- for (std::vector<cmTargetInternals::IncludeDirectoriesEntry*>::const_iterator
- it = this->Internal->IncludeDirectoriesEntries.begin(),
- end = this->Internal->IncludeDirectoriesEntries.end();
- it != end; ++it)
- {
- std::vector<std::string> entryIncludes;
- cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(this->Makefile,
- config,
- false,
- this,
- &dagChecker),
- entryIncludes);
- for(std::vector<std::string>::const_iterator
- li = entryIncludes.begin(); li != entryIncludes.end(); ++li)
- {
- std::string inc = *li;
- if (!cmSystemTools::IsOff(inc.c_str()))
- {
- cmSystemTools::ConvertToUnixSlashes(inc);
- }
-
- if (!(*it)->ImpliedByTargetLinkLibraries)
- {
- if (fromTll.find(*li) != fromTll.end())
- {
- switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0020))
- {
- case cmPolicies::WARN:
- {
- cmOStringStream e;
- e << "The include directory " << *li << " was specified "
- "implicitly by an earlier call to target_link_libraries. "
- "Preserving the order of includes as if the earlier use of "
- "target_link_libraries had not added it."
- << this->Makefile->GetPolicies()->GetPolicyWarning(
- cmPolicies::CMP0020);
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
- }
- // Fall through to OLD behavior
- case cmPolicies::OLD:
- includes.erase(cmStdRemove(includes.begin(),
- includes.end(), *li),
- includes.end());
- fromTll.erase(*li);
- includes.push_back(*li);
- break;
- case cmPolicies::REQUIRED_ALWAYS:
- case cmPolicies::REQUIRED_IF_USED:
- case cmPolicies::NEW:
- break;
- }
- }
- }
- if(uniqueIncludes.insert(inc).second)
- {
- if ((*it)->ImpliedByTargetLinkLibraries)
- {
- fromTll.insert(*li);
- }
- includes.push_back(*li);
- }
- }
- }
- return includes;
-}
-
-//----------------------------------------------------------------------------
void cmTarget::MaybeInvalidatePropertyCache(const char* prop)
{
// Wipe out maps caching information affected by this property.
@@ -3062,23 +2815,6 @@ const char *cmTarget::GetProperty(const char* prop,
}
}
}
- if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
- {
- this->Internal->IncludeDirectoriesString = "";
- std::string sep;
- typedef cmTargetInternals::IncludeDirectoriesEntry
- IncludeDirectoriesEntry;
- for (std::vector<IncludeDirectoriesEntry*>::const_iterator
- it = this->Internal->IncludeDirectoriesEntries.begin(),
- end = this->Internal->IncludeDirectoriesEntries.end();
- it != end; ++it)
- {
- this->Internal->IncludeDirectoriesString += sep;
- this->Internal->IncludeDirectoriesString += (*it)->ge->GetInput();
- sep = ";";
- }
- return this->Internal->IncludeDirectoriesString.c_str();
- }
}
if (strcmp(prop,"IMPORTED") == 0)
@@ -4502,28 +4238,6 @@ cmTarget::GetImportInfo(const char* config)
return &i->second;
}
-
-bool handleCMP0019(const std::vector<std::string> &newLinkLibraries,
- const std::vector<std::string> &oldLinkLibraries)
-{
- if (newLinkLibraries.size() != oldLinkLibraries.size())
- {
- return false;
- }
- for(std::vector<std::string>::const_iterator
- oll = oldLinkLibraries.begin(), nll = newLinkLibraries.begin();
- oll != oldLinkLibraries.end() && nll != newLinkLibraries.end();
- ++oll, ++nll)
- {
- if (*oll != *nll)
- {
- return false;
- }
- }
- return true;
-}
-
-
//----------------------------------------------------------------------------
void cmTarget::ComputeImportInfo(std::string const& desired_config,
ImportInfo& info)
@@ -4727,79 +4441,21 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
// Get the link interface.
{
- std::vector<std::string> newInterfaceLibs;
- const char* newStyleLibsProp = this->GetProperty("INTERFACE_LINK_LIBRARIES");
- if(newStyleLibsProp)
- {
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
-
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "INTERFACE_LINK_LIBRARIES", 0, 0);
- cmSystemTools::ExpandListArgument(ge.Parse(newStyleLibsProp)
- ->Evaluate(this->Makefile,
- desired_config.c_str(),
- false,
- this,
- &dagChecker),
- newInterfaceLibs);
- }
-
std::string linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES";
- std::vector<std::string> oldInterfaceLibs;
- const char *oldProp = this->GetProperty((linkProp + suffix).c_str());
- if(oldProp)
- {
- linkProp += suffix;
- cmSystemTools::ExpandListArgument(oldProp,
- oldInterfaceLibs);
- }
- else
+ linkProp += suffix;
+ if(const char* config_libs = this->GetProperty(linkProp.c_str()))
{
- oldProp = this->GetProperty("IMPORTED_LINK_INTERFACE_LIBRARIES");
- if(oldProp)
- {
- cmSystemTools::ExpandListArgument(oldProp,
- oldInterfaceLibs);
- }
+ cmSystemTools::ExpandListArgument(config_libs,
+ info.LinkInterface.Libraries);
}
-
- std::vector<std::string> usedLinkLibraries;
- switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0019))
+ else if(const char* libs =
+ this->GetProperty("IMPORTED_LINK_INTERFACE_LIBRARIES"))
{
- case cmPolicies::WARN:
- {
- if (newStyleLibsProp && oldProp
- && !handleCMP0019(newInterfaceLibs, oldInterfaceLibs))
- {
- cmOStringStream e;
- e << "The " << linkProp << " and "
- "LINK_INTERFACE_LIBRARIES are not the same for target \""
- << this->GetName() << "\". NEW content is \""
- << (newStyleLibsProp ? newStyleLibsProp : "(unset)") << "\"\n"
- "OLD content is \""
- << (oldProp ? oldProp : "(unset)") << "\"\n"
- << this->Makefile->GetPolicies()->GetPolicyWarning(
- cmPolicies::CMP0019);
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
- }
- // fall through to OLD behaviour
- }
- case cmPolicies::OLD:
- usedLinkLibraries = oldInterfaceLibs;
- break;
- case cmPolicies::REQUIRED_IF_USED:
- case cmPolicies::REQUIRED_ALWAYS:
- case cmPolicies::NEW:
- default:
- usedLinkLibraries = newInterfaceLibs;
+ cmSystemTools::ExpandListArgument(libs,
+ info.LinkInterface.Libraries);
}
- info.LinkInterface.Libraries.insert(info.LinkInterface.Libraries.end(),
- usedLinkLibraries.begin(), usedLinkLibraries.end());
}
-
// Get the link dependencies.
{
std::string linkProp = "IMPORTED_LINK_DEPENDENT_LIBRARIES";
@@ -4906,81 +4562,20 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface)
// An explicit list of interface libraries may be set for shared
// libraries and executables that export symbols.
- bool explicitLibraries = false;
- std::vector<std::string> usedLinkLibraries;
+ const char* explicitLibraries = 0;
if(this->GetType() == cmTarget::SHARED_LIBRARY ||
this->IsExecutableWithExports())
{
- const char *newLibrariesProp =
- this->GetProperty("INTERFACE_LINK_LIBRARIES");
-
- std::vector<std::string> newInterfaceLibs;
- std::vector<std::string> oldInterfaceLibs;
-
- if(newLibrariesProp)
- {
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
-
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "INTERFACE_LINK_LIBRARIES", 0, 0);
-
- cmSystemTools::ExpandListArgument(ge.Parse(newLibrariesProp)->Evaluate(
- this->Makefile,
- config,
- false,
- this,
- &dagChecker), newInterfaceLibs);
- }
// Lookup the per-configuration property.
std::string propName = "LINK_INTERFACE_LIBRARIES";
propName += suffix;
- const char *oldLibrariesProp = this->GetProperty(propName.c_str());
+ explicitLibraries = this->GetProperty(propName.c_str());
// If not set, try the generic property.
- if(!oldLibrariesProp)
- {
- oldLibrariesProp = this->GetProperty("LINK_INTERFACE_LIBRARIES");
- }
- if(oldLibrariesProp)
+ if(!explicitLibraries)
{
- cmSystemTools::ExpandListArgument(oldLibrariesProp, oldInterfaceLibs);
+ explicitLibraries = this->GetProperty("LINK_INTERFACE_LIBRARIES");
}
-
- {
- switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0019))
- {
- case cmPolicies::WARN:
- {
- if (newLibrariesProp && oldLibrariesProp
- && !handleCMP0019(newInterfaceLibs, oldInterfaceLibs))
- {
- cmOStringStream e;
- e << "The INTERFACE_LINK_LIBRARIES and LINK_INTERFACE_LIBRARIES are "
- "not the same for target \"" << this->GetName() << "\".\n"
- "NEW content is \""
- << (newLibrariesProp ? newLibrariesProp : "(unset)") << "\"\n"
- "OLD content is \""
- << (oldLibrariesProp ? oldLibrariesProp : "(unset)") << "\"\n"
- << this->Makefile->GetPolicies()->GetPolicyWarning(
- cmPolicies::CMP0019);
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
- }
- // fall through to OLD behaviour
- }
- case cmPolicies::OLD:
- explicitLibraries = oldLibrariesProp ? true : false;
- usedLinkLibraries = oldInterfaceLibs;
- break;
- case cmPolicies::REQUIRED_IF_USED:
- case cmPolicies::REQUIRED_ALWAYS:
- case cmPolicies::NEW:
- default:
- usedLinkLibraries = newInterfaceLibs;
- explicitLibraries = newLibrariesProp ? true : false;
- }
- }
}
// There is no implicit link interface for executables or modules
@@ -4997,8 +4592,7 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface)
if(explicitLibraries)
{
// The interface libraries have been explicitly set.
- iface.Libraries.insert(iface.Libraries.end(),
- usedLinkLibraries.begin(), usedLinkLibraries.end());
+ cmSystemTools::ExpandListArgument(explicitLibraries, iface.Libraries);
if(this->GetType() == cmTarget::SHARED_LIBRARY)
{
@@ -5104,19 +4698,21 @@ void cmTarget::ComputeLinkImplementation(const char* config,
cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
// Collect libraries directly linked in this configuration.
- std::vector<std::string> llibs;
- this->GetDirectLinkLibraries(config, llibs);
- for(std::vector<std::string>::const_iterator li = llibs.begin();
+ LinkLibraryVectorType const& llibs = this->GetOriginalLinkLibraries();
+ for(cmTarget::LinkLibraryVectorType::const_iterator li = llibs.begin();
li != llibs.end(); ++li)
{
// Skip entries that resolve to the target itself or are empty.
- std::string item = this->CheckCMP0004(*li);
+ std::string item = this->CheckCMP0004(li->first);
if(item == this->GetName() || item.empty())
{
continue;
}
- // The entry is meant for this configuration.
- impl.Libraries.push_back(item);
+ if(li->second == cmTarget::GENERAL || li->second == linkType)
+ {
+ // The entry is meant for this configuration.
+ impl.Libraries.push_back(item);
+ }
}
LinkLibraryVectorType const& oldllibs = this->GetOriginalLinkLibraries();
@@ -5343,7 +4939,6 @@ cmTargetInternalPointer
//----------------------------------------------------------------------------
cmTargetInternalPointer::~cmTargetInternalPointer()
{
- deleteAndClear(this->Pointer->IncludeDirectoriesEntries);
delete this->Pointer;
}
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 3cd35f4..9efd638 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -99,10 +99,6 @@ public:
cmPolicies::PolicyStatus GetPolicyStatusCMP0008() const
{ return this->PolicyStatusCMP0008; }
- /** Get the status of policy CMP0019 when the target was created. */
- cmPolicies::PolicyStatus GetPolicyStatusCMP0019() const
- { return this->PolicyStatusCMP0019; }
-
/**
* Get the list of the custom commands for this target
*/
@@ -114,8 +110,7 @@ public:
{return this->PostBuildCommands;}
///! Return the list of frameworks being linked to this target
- void GetFrameworks(const char *config,
- std::vector<std::string> &frameworks);
+ std::vector<std::string> &GetFrameworks() {return this->Frameworks;}
/**
* Get the list of the source files used by this target
@@ -173,8 +168,6 @@ public:
return this->LinkLibraries;}
const LinkLibraryVectorType &GetOriginalLinkLibraries() const
{return this->OriginalLinkLibraries;}
- void GetDirectLinkLibraries(const char *config,
- std::vector<std::string> &) const;
/** Compute the link type to use for the given configuration. */
LinkLibraryType ComputeLinkType(const char* config);
@@ -186,6 +179,7 @@ public:
// Check to see if a library is a framework and treat it different on Mac
bool NameResolvesToFramework(const std::string& libname);
+ bool AddFramework(const std::string& lib, LinkLibraryType llt);
void AddLinkLibrary(cmMakefile& mf,
const char *target, const char* lib,
LinkLibraryType llt);
@@ -480,11 +474,6 @@ public:
/** @return the Mac framework directory without the base. */
std::string GetFrameworkDirectory(const char* config = 0);
- void AppendTLLIncludeDirectories(const std::string &includes);
- void PrependTLLIncludeDirectories(const std::string &includes);
-
- std::vector<std::string> GetIncludeDirectories(const char *config);
-
private:
/**
* A list of direct dependencies. Use in conjunction with DependencyMap.
@@ -580,6 +569,7 @@ private:
LinkLibraryVectorType LinkLibraries;
LinkLibraryVectorType PrevLinkedLibraries;
bool LinkLibrariesAnalyzed;
+ std::vector<std::string> Frameworks;
std::vector<std::string> LinkDirectories;
std::set<cmStdString> LinkDirectoriesEmmitted;
bool HaveInstallRule;
@@ -628,7 +618,6 @@ private:
cmPolicies::PolicyStatus PolicyStatusCMP0003;
cmPolicies::PolicyStatus PolicyStatusCMP0004;
cmPolicies::PolicyStatus PolicyStatusCMP0008;
- cmPolicies::PolicyStatus PolicyStatusCMP0019;
// Internal representation details.
friend class cmTargetInternals;
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 2ccdc01..f42b0f6 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -232,11 +232,7 @@ bool cmTargetLinkLibrariesCommand
{
this->Target->SetProperty("LINK_INTERFACE_LIBRARIES", "");
}
- if(this->CurrentProcessingState != ProcessingLinkLibraries &&
- !this->Target->GetProperty("INTERFACE_LINK_LIBRARIES"))
- {
- this->Target->SetProperty("INTERFACE_LINK_LIBRARIES", "");
- }
+
return true;
}
@@ -254,71 +250,10 @@ cmTargetLinkLibrariesCommand
}
//----------------------------------------------------------------------------
-static std::string generatorIface(const std::string &value,
- cmTarget::LinkLibraryType llt)
-{
- if (llt == cmTarget::DEBUG)
- {
- return "$<$<CONFIG:Debug>:"
- + value
- + ">";
- }
- else if (llt == cmTarget::OPTIMIZED)
- {
- return "$<$<NOT:$<CONFIG:Debug>>:"
- + value
- + ">";
- }
- return value;
-}
-
-//----------------------------------------------------------------------------
-static std::string compileProperty(const std::string &lib,
- const std::string &property,
- cmTarget::LinkLibraryType llt)
-{
- return generatorIface(std::string("$<$<TARGET_DEFINED:" + lib + ">"
- ":$<TARGET_PROPERTY:")
- + lib
- + ",INTERFACE_" + property + ">>", llt);
-}
-
-//----------------------------------------------------------------------------
-static bool isGeneratorExpression(const std::string &lib)
-{
- const std::string::size_type openpos = lib.find("$<");
- return (openpos != std::string::npos)
- && (lib.find(">", openpos) != std::string::npos);
-}
-
-//----------------------------------------------------------------------------
-static bool isList(const char *lib)
-{
- std::vector<std::string> result;
- cmSystemTools::ExpandListArgument(lib, result);
- return result.size() > 1;
-}
-
-//----------------------------------------------------------------------------
void
cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
cmTarget::LinkLibraryType llt)
{
- cmTarget *tgt = this->Makefile->FindTargetToUse(lib);
- const bool isNonImportedTarget = tgt && !tgt->IsImported();
- const bool isGenex = isGeneratorExpression(lib);
- const std::string nsLib =
- std::string(isNonImportedTarget && !isList(lib)
- ? "$<EXPORT_NAMESPACE>" : "") + lib;
- if (tgt || isGenex)
- {
- this->Target->AppendTLLIncludeDirectories(compileProperty(nsLib,
- "INCLUDE_DIRECTORIES", llt));
- this->Target->AppendProperty("COMPILE_DEFINITIONS",
- compileProperty(nsLib,
- "COMPILE_DEFINITIONS", llt).c_str());
- }
-
// Handle normal case first.
if(this->CurrentProcessingState != ProcessingLinkInterface)
{
@@ -331,15 +266,6 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
}
}
- this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
- generatorIface(nsLib, llt).c_str());
- this->Target->AppendProperty("INTERFACE_COMPILE_DEFINITIONS",
- compileProperty(nsLib,
- "COMPILE_DEFINITIONS", llt).c_str());
- this->Target->AppendProperty("INTERFACE_INCLUDE_DIRECTORIES",
- compileProperty(nsLib,
- "INCLUDE_DIRECTORIES", llt).c_str());
-
// Get the list of configurations considered to be DEBUG.
std::vector<std::string> const& debugConfigs =
this->Makefile->GetCMakeInstance()->GetDebugConfigs();
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 42f511e..2f650e7 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -112,7 +112,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
else
{
// Use the command name given.
- exe = ge.Parse(exe.c_str())->Evaluate(mf, config);
+ exe = ge.Parse(exe.c_str()).Evaluate(mf, config);
cmSystemTools::ConvertToUnixSlashes(exe);
}
@@ -122,7 +122,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
for(std::vector<std::string>::const_iterator ci = command.begin()+1;
ci != command.end(); ++ci)
{
- os << " " << lg->EscapeForCMake(ge.Parse(*ci)->Evaluate(mf, config));
+ os << " " << lg->EscapeForCMake(ge.Parse(*ci).Evaluate(mf, config));
}
// Finish the test command.
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 1e3094c..1faa888 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -37,11 +37,11 @@ target_link_libraries(depB LINK_PRIVATE depA)
add_library(depC SHARED depC.cpp)
generate_export_header(depC)
-target_link_libraries(depC LINK_PUBLIC $<1:depA>)
+target_link_libraries(depC LINK_PUBLIC depA)
assert_property(depA LINK_INTERFACE_LIBRARIES "")
assert_property(depB LINK_INTERFACE_LIBRARIES "")
-assert_property(depC LINK_INTERFACE_LIBRARIES "$<1:depA>")
+assert_property(depC LINK_INTERFACE_LIBRARIES "depA")
add_executable(targetA targetA.cpp)
@@ -56,45 +56,3 @@ assert_property(targetA LINK_INTERFACE_LIBRARIES "")
target_link_libraries(targetA depB depC)
assert_property(targetA LINK_INTERFACE_LIBRARIES "")
-
-# cmake_policy(PUSH)
-
-cmake_policy(SET CMP0019 NEW)
-
-add_library(depD SHARED depD.cpp)
-generate_export_header(depD)
-set_property(TARGET depD APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<1:depA>)
-
-add_library(depE SHARED depE.cpp)
-generate_export_header(depE)
-target_link_libraries(depE LINK_PRIVATE depB)
-target_link_libraries(depE LINK_INTERFACE_LIBRARIES $<1:depB>)
-
-add_executable(targetB targetB.cpp)
-target_link_libraries(targetB depD depE)
-
-# cmake_policy(POP)
-
-
-macro(create_header _name)
- file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_name}")
- file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_name}/${_name}.h" "//${_name}.h\n")
-endmacro()
-
-create_header(foo)
-create_header(bar)
-
-add_library(depF SHARED depF.cpp)
-generate_export_header(depF)
-set_property(TARGET depF PROPERTY
- INTERFACE_INCLUDE_DIRECTORIES
- ${CMAKE_CURRENT_BINARY_DIR}/foo
- ${CMAKE_CURRENT_BINARY_DIR}/bar
-)
-set_property(TARGET depF PROPERTY
- INTERFACE_COMPILE_DEFINITIONS
- TEST_DEF
-)
-
-add_library(targetC targetC.cpp)
-target_link_libraries(targetC depF)
diff --git a/Tests/CMakeCommands/target_link_libraries/depD.cpp b/Tests/CMakeCommands/target_link_libraries/depD.cpp
deleted file mode 100644
index b02c76c..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depD.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#include "depD.h"
-
-int DepD::foo()
-{
- return 0;
-}
-
-DepA DepD::getA()
-{
- DepA a;
- return a;
-}
diff --git a/Tests/CMakeCommands/target_link_libraries/depD.h b/Tests/CMakeCommands/target_link_libraries/depD.h
deleted file mode 100644
index d24ff5f..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depD.h
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#include "depd_export.h"
-
-#include "depA.h"
-
-struct DEPD_EXPORT DepD
-{
- int foo();
-
- DepA getA();
-};
diff --git a/Tests/CMakeCommands/target_link_libraries/depE.cpp b/Tests/CMakeCommands/target_link_libraries/depE.cpp
deleted file mode 100644
index 1a3da4a..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depE.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#include "depE.h"
-
-int DepE::foo()
-{
- return 0;
-}
-
-DepB DepE::getB()
-{
- DepB a;
- return a;
-}
diff --git a/Tests/CMakeCommands/target_link_libraries/depE.h b/Tests/CMakeCommands/target_link_libraries/depE.h
deleted file mode 100644
index 2273e17..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depE.h
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#include "depe_export.h"
-
-#include "depB.h"
-
-struct DEPE_EXPORT DepE
-{
- int foo();
-
- DepB getB();
-};
diff --git a/Tests/CMakeCommands/target_link_libraries/depF.cpp b/Tests/CMakeCommands/target_link_libraries/depF.cpp
deleted file mode 100644
index 1fd29c4..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depF.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#include "depF.h"
-
-int DepF::foo()
-{
- return 0;
-}
diff --git a/Tests/CMakeCommands/target_link_libraries/depF.h b/Tests/CMakeCommands/target_link_libraries/depF.h
deleted file mode 100644
index 95d6b14..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depF.h
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#include "depf_export.h"
-
-struct DEPF_EXPORT DepF
-{
- int foo();
-};
diff --git a/Tests/CMakeCommands/target_link_libraries/targetB.cpp b/Tests/CMakeCommands/target_link_libraries/targetB.cpp
deleted file mode 100644
index c6a1264..0000000
--- a/Tests/CMakeCommands/target_link_libraries/targetB.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#include "depD.h"
-#include "depE.h"
-
-int main(int argc, char **argv)
-{
- DepD d;
- DepA a = d.getA();
-
- DepE e;
- DepB b = e.getB();
-
- return d.foo() + a.foo() + e.foo() + b.foo();
-}
diff --git a/Tests/CMakeCommands/target_link_libraries/targetC.cpp b/Tests/CMakeCommands/target_link_libraries/targetC.cpp
deleted file mode 100644
index ac33c67..0000000
--- a/Tests/CMakeCommands/target_link_libraries/targetC.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#include "depF.h"
-
-#include "foo.h"
-#include "bar.h"
-
-#ifndef TEST_DEF
-#error Expected TEST_DEF definition
-#endif
-
-int main(int argc, char **argv)
-{
- DepF f;
-
- return f.foo();
-}
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 66c190a..3a92d81 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 2.8.8)
project(GeneratorExpression NONE)
-add_custom_target(check-part1 ALL
+add_custom_target(check ALL
COMMAND ${CMAKE_COMMAND}
-Dtest_0=$<0:nothing>
-Dtest_0_with_comma=$<0:-Wl,--no-undefined>
@@ -57,13 +57,6 @@ add_custom_target(check-part1 ALL
-Dtest_colons_3=$<1:Qt5::Core>
-Dtest_colons_4=$<1:C:\\CMake>
-Dtest_colons_5=$<1:C:/CMake>
- -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part1.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 1 of 2)"
- VERBATIM
- )
-
-add_custom_target(check-part2 ALL
- COMMAND ${CMAKE_COMMAND}
-Dtest_incomplete_1=$<
-Dtest_incomplete_2=$<something
-Dtest_incomplete_3=$<something:
@@ -85,10 +78,7 @@ add_custom_target(check-part2 ALL
-Dtest_incomplete_19=$<1:some,thing$<ANGLE-R>
-Dtest_incomplete_20=$<CONFIGURATION$<ANGLE-R>
-Dtest_incomplete_21=$<BOOL:something$<ANGLE-R>
- -Dtest_build_interface=$<BUILD_INTERFACE:build>
- -Dtest_install_interface=$<INSTALL_INTERFACE:install>
- -Dtest_export_namespace=$<EXPORT_NAMESPACE>x
- -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part2.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 2)"
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake
+ COMMAND ${CMAKE_COMMAND} -E echo "check done"
VERBATIM
)
diff --git a/Tests/GeneratorExpression/check-common.cmake b/Tests/GeneratorExpression/check-common.cmake
deleted file mode 100644
index 8ffebd7..0000000
--- a/Tests/GeneratorExpression/check-common.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-macro(check var val)
- if(NOT "${${var}}" STREQUAL "${val}")
- message(SEND_ERROR "${var} is \"${${var}}\", not \"${val}\"")
- endif()
-endmacro()
diff --git a/Tests/GeneratorExpression/check-part1.cmake b/Tests/GeneratorExpression/check-part1.cmake
deleted file mode 100644
index 7abfa82..0000000
--- a/Tests/GeneratorExpression/check-part1.cmake
+++ /dev/null
@@ -1,56 +0,0 @@
-
-include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake)
-
-message(STATUS "config=[${config}]")
-check(test_0 "")
-check(test_0_with_comma "")
-check(test_1 "content")
-check(test_1_with_comma "-Wl,--no-undefined")
-check(test_and_0 "0")
-check(test_and_0_0 "0")
-check(test_and_0_1 "0")
-check(test_and_1 "1")
-check(test_and_1_0 "0")
-check(test_and_1_1 "1")
-check(test_and_0_invalidcontent "0")
-check(test_config_0 "0")
-check(test_config_1 "1")
-foreach(c debug release relwithdebinfo minsizerel)
- if(NOT "${test_config_${c}}" MATCHES "^(0+|1+)$")
- message(SEND_ERROR "test_config_${c} is \"${test_config_${c}}\", not all 0 or all 1")
- endif()
-endforeach()
-check(test_not_0 "1")
-check(test_not_1 "0")
-check(test_or_0 "0")
-check(test_or_0_0 "0")
-check(test_or_0_1 "1")
-check(test_or_1 "1")
-check(test_or_1_0 "1")
-check(test_or_1_1 "1")
-check(test_or_1_invalidcontent "1")
-check(test_bool_notfound "0")
-check(test_bool_foo_notfound "0")
-check(test_bool_true "1")
-check(test_bool_false "0")
-check(test_bool_on "1")
-check(test_bool_off "0")
-check(test_bool_no "0")
-check(test_bool_n "0")
-check(test_bool_empty "0")
-check(test_strequal_yes_yes "1")
-check(test_strequal_yes_yes_cs "0")
-check(test_strequal_yes_no "0")
-check(test_strequal_no_yes "0")
-check(test_strequal_angle_r "1")
-check(test_strequal_comma "1")
-check(test_strequal_angle_r_comma "0")
-check(test_strequal_both_empty "1")
-check(test_strequal_one_empty "0")
-check(test_angle_r ">")
-check(test_comma ",")
-check(test_colons_1 ":")
-check(test_colons_2 "::")
-check(test_colons_3 "Qt5::Core")
-check(test_colons_4 "C:\\\\CMake")
-check(test_colons_5 "C:/CMake")
diff --git a/Tests/GeneratorExpression/check-part2.cmake b/Tests/GeneratorExpression/check-part2.cmake
deleted file mode 100644
index 4201345..0000000
--- a/Tests/GeneratorExpression/check-part2.cmake
+++ /dev/null
@@ -1,27 +0,0 @@
-
-include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake)
-
-check(test_incomplete_1 "$<")
-check(test_incomplete_2 "$<something")
-check(test_incomplete_3 "$<something:")
-check(test_incomplete_4 "$<something:,")
-check(test_incomplete_5 "$something:,>")
-check(test_incomplete_6 "<something:,>")
-check(test_incomplete_7 "$<something::")
-check(test_incomplete_8 "$<something:,")
-check(test_incomplete_9 "$<something:,,")
-check(test_incomplete_10 "$<something:,:")
-check(test_incomplete_11 "$<something,,")
-check(test_incomplete_12 "$<,,")
-check(test_incomplete_13 "$<somespecialthing")
-check(test_incomplete_14 "$<>")
-check(test_incomplete_15 "$<some$<thing")
-check(test_incomplete_16 "$<BOOL:something")
-check(test_incomplete_17 "some$thing")
-check(test_incomplete_18 "$<1:some,thing")
-check(test_incomplete_19 "$<1:some,thing>")
-check(test_incomplete_20 "$<CONFIGURATION>")
-check(test_incomplete_21 "$<BOOL:something>")
-check(test_build_interface "build")
-check(test_install_interface "")
-check(test_export_namespace "x")
diff --git a/Tests/GeneratorExpression/check.cmake b/Tests/GeneratorExpression/check.cmake
new file mode 100644
index 0000000..af436de
--- /dev/null
+++ b/Tests/GeneratorExpression/check.cmake
@@ -0,0 +1,80 @@
+macro(check var val)
+ if(NOT "${${var}}" STREQUAL "${val}")
+ message(SEND_ERROR "${var} is \"${${var}}\", not \"${val}\"")
+ endif()
+endmacro()
+
+message(STATUS "config=[${config}]")
+check(test_0 "")
+check(test_0_with_comma "")
+check(test_1 "content")
+check(test_1_with_comma "-Wl,--no-undefined")
+check(test_and_0 "0")
+check(test_and_0_0 "0")
+check(test_and_0_1 "0")
+check(test_and_1 "1")
+check(test_and_1_0 "0")
+check(test_and_1_1 "1")
+check(test_and_0_invalidcontent "0")
+check(test_config_0 "0")
+check(test_config_1 "1")
+foreach(c debug release relwithdebinfo minsizerel)
+ if(NOT "${test_config_${c}}" MATCHES "^(0+|1+)$")
+ message(SEND_ERROR "test_config_${c} is \"${test_config_${c}}\", not all 0 or all 1")
+ endif()
+endforeach()
+check(test_not_0 "1")
+check(test_not_1 "0")
+check(test_or_0 "0")
+check(test_or_0_0 "0")
+check(test_or_0_1 "1")
+check(test_or_1 "1")
+check(test_or_1_0 "1")
+check(test_or_1_1 "1")
+check(test_or_1_invalidcontent "1")
+check(test_bool_notfound "0")
+check(test_bool_foo_notfound "0")
+check(test_bool_true "1")
+check(test_bool_false "0")
+check(test_bool_on "1")
+check(test_bool_off "0")
+check(test_bool_no "0")
+check(test_bool_n "0")
+check(test_bool_empty "0")
+check(test_strequal_yes_yes "1")
+check(test_strequal_yes_yes_cs "0")
+check(test_strequal_yes_no "0")
+check(test_strequal_no_yes "0")
+check(test_strequal_angle_r "1")
+check(test_strequal_comma "1")
+check(test_strequal_angle_r_comma "0")
+check(test_strequal_both_empty "1")
+check(test_strequal_one_empty "0")
+check(test_angle_r ">")
+check(test_comma ",")
+check(test_colons_1 ":")
+check(test_colons_2 "::")
+check(test_colons_3 "Qt5::Core")
+check(test_colons_4 "C:\\\\CMake")
+check(test_colons_5 "C:/CMake")
+check(test_incomplete_1 "$<")
+check(test_incomplete_2 "$<something")
+check(test_incomplete_3 "$<something:")
+check(test_incomplete_4 "$<something:,")
+check(test_incomplete_5 "$something:,>")
+check(test_incomplete_6 "<something:,>")
+check(test_incomplete_7 "$<something::")
+check(test_incomplete_8 "$<something:,")
+check(test_incomplete_9 "$<something:,,")
+check(test_incomplete_10 "$<something:,:")
+check(test_incomplete_11 "$<something,,")
+check(test_incomplete_12 "$<,,")
+check(test_incomplete_13 "$<somespecialthing")
+check(test_incomplete_14 "$<>")
+check(test_incomplete_15 "$<some$<thing")
+check(test_incomplete_16 "$<BOOL:something")
+check(test_incomplete_17 "some$thing")
+check(test_incomplete_18 "$<1:some,thing")
+check(test_incomplete_19 "$<1:some,thing>")
+check(test_incomplete_20 "$<CONFIGURATION>")
+check(test_incomplete_21 "$<BOOL:something>")
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
index 2a0d1a8..7cb1b42 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -45,23 +45,3 @@ set_property(TARGET TargetIncludeDirectories
APPEND PROPERTY INCLUDE_DIRECTORIES
"$<TARGET_PROPERTY:somelib::withcolons,INTERFACE_INCLUDE_DIRECTORIES>"
)
-
-create_header(fee)
-create_header(fiy)
-create_header(foh)
-create_header(fum)
-
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib1.cpp" "#include \"fee.h\"\n")
-add_library(lib1 "${CMAKE_CURRENT_BINARY_DIR}/lib1.cpp")
-set_property(TARGET lib1 APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/fee")
-set_property(TARGET lib1 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/fiy")
-set_property(TARGET lib1 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CMAKE_CURRENT_BINARY_DIR}/foh>")
-
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib2.cpp" "#include \"fiy.h\"\n")
-add_library(lib2 "${CMAKE_CURRENT_BINARY_DIR}/lib2.cpp")
-set_property(TARGET lib2 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/fum;$<TARGET_PROPERTY:lib1,INTERFACE_INCLUDE_DIRECTORIES>")
-set_property(TARGET lib2 APPEND PROPERTY INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:lib1,INTERFACE_INCLUDE_DIRECTORIES>")
-
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main3.cpp" "#include \"fiy.h\"\n#include \"foh.h\"\n#include \"fum.h\"\nint main(int,char**) { return 0; }\n")
-add_executable(exe3 "${CMAKE_CURRENT_BINARY_DIR}/main3.cpp")
-set_property(TARGET exe3 APPEND PROPERTY INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:lib2,INTERFACE_INCLUDE_DIRECTORIES>")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3ce0225294330b5362f8438b13b676c50534cb7f
commit 3ce0225294330b5362f8438b13b676c50534cb7f
Merge: f9deedc 955d111
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 30 10:44:07 2012 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Nov 30 10:44:07 2012 -0500
Merge commit '955d111c30cc8b171d5b616961ef8e6ca0a48da1' into old-link-interface-genex
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=668cba21af75e61a9feac1c22c0229f3d6a0e885
commit 668cba21af75e61a9feac1c22c0229f3d6a0e885
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Nov 30 10:42:33 2012 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Nov 30 10:43:00 2012 -0500
Revert topic 'add-INTERFACE_LINK_LIBRARIES-property'
Revert commits:
42c1669c Simplify logic of CMP0019.
8f77e068 Genex: Add INTERFACE_LINK_LIBRARIES property
9737cec6 Add expressions for separating build-location from install-location.
diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h
index 2899e05..445fd0e 100644
--- a/Source/cmDocumentGeneratorExpressions.h
+++ b/Source/cmDocumentGeneratorExpressions.h
@@ -26,15 +26,6 @@
"strings which contain a '>' for example.\n" \
" $<COMMA> = A literal ','. Used to compare " \
"strings which contain a ',' for example.\n" \
- " $<INSTALL_INTERFACE:...> = content of \"...\" when the property " \
- "is exported using install(EXPORT), and empty otherwise.\n" \
- " $<BUILD_INTERFACE:...> = content of \"...\" when the property " \
- "is exported using export(), or when the target is used by another " \
- "target in the same buildsystem. Expands to the empty string " \
- "otherwise.\n" \
- " $<EXPORT_NAMESPACE> = The namespace used in an invokation " \
- "of export() or install(EXPORT). Expands to empty in other " \
- "contexts.\n" \
" $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)\n" \
" $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n" \
" $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)\n" \
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 2502b92..55d70f8 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1397,14 +1397,6 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
false,
"Variables that Control the Build");
cm->DefineProperty
- ("CMAKE_INTERFACE_LINK_LIBRARIES", cmProperty::VARIABLE,
- "Default value for INTERFACE_LINK_LIBRARIES of targets.",
- "This variable is used to initialize the "
- "INTERFACE_LINK_LIBRARIES property on all the targets. "
- "See that target property for additional information.",
- false,
- "Variables that Control the Build");
- cm->DefineProperty
("CMAKE_WIN32_EXECUTABLE", cmProperty::VARIABLE,
"Default value for WIN32_EXECUTABLE of targets.",
"This variable is used to initialize the "
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index a86f8c4..fb3f39f 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -12,7 +12,6 @@
#include "cmExportBuildFileGenerator.h"
#include "cmExportCommand.h"
-#include "cmGeneratorExpression.h"
//----------------------------------------------------------------------------
cmExportBuildFileGenerator::cmExportBuildFileGenerator()
@@ -32,17 +31,6 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
if(this->ExportedTargets.insert(te).second)
{
this->GenerateImportTargetCode(os, te);
-
- ImportPropertyMap properties;
-
- if ((*tei)->GetPolicyStatusCMP0019() == cmPolicies::NEW)
- {
- this->PopulateInterfaceProperty("INTERFACE_LINK_LIBRARIES", te,
- cmGeneratorExpression::BuildInterface,
- properties);
- }
-
- this->GenerateInterfaceProperties(te, os, properties);
}
else
{
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index a67c3ee..8dffae4 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -125,50 +125,6 @@ void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
}
//----------------------------------------------------------------------------
-void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
- cmTarget *target,
- cmGeneratorExpression::PreprocessContext preprocessRule,
- ImportPropertyMap &properties)
-{
- const char *input = target->GetProperty(propName);
- if (input)
- {
- if (!*input)
- {
- // Set to empty
- properties[propName] = "";
- return;
- }
- std::string prepro = cmGeneratorExpression::Preprocess(input,
- preprocessRule,
- this->Namespace.c_str());
- if (!prepro.empty())
- {
- properties[propName] = prepro;
- }
- }
-}
-
-//----------------------------------------------------------------------------
-void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget *target,
- std::ostream& os,
- const ImportPropertyMap &properties)
-{
- if (!properties.empty())
- {
- std::string targetName = this->Namespace;
- targetName += target->GetName();
- os << "SET_TARGET_PROPERTIES(" << targetName << " PROPERTIES\n";
- for(ImportPropertyMap::const_iterator pi = properties.begin();
- pi != properties.end(); ++pi)
- {
- os << " " << pi->first << " \"" << pi->second << "\"\n";
- }
- os << ")\n\n";
- }
-}
-
-//----------------------------------------------------------------------------
void
cmExportFileGenerator
::SetImportDetailProperties(const char* config, std::string const& suffix,
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 3aee1b8..70bc65d 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -13,7 +13,6 @@
#define cmExportFileGenerator_h
#include "cmCommand.h"
-#include "cmGeneratorExpression.h"
/** \class cmExportFileGenerator
* \brief Generate a file exporting targets from a build or install tree.
@@ -92,12 +91,6 @@ protected:
cmMakefile* mf,
cmTarget* depender,
cmTarget* dependee) = 0;
- void PopulateInterfaceProperty(const char *,
- cmTarget *target,
- cmGeneratorExpression::PreprocessContext,
- ImportPropertyMap &properties);
- void GenerateInterfaceProperties(cmTarget *target, std::ostream& os,
- const ImportPropertyMap &properties);
// The namespace in which the exports are placed in the generated file.
std::string Namespace;
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 4fef08e..7841731 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -19,7 +19,6 @@
#include "cmInstallExportGenerator.h"
#include "cmInstallTargetGenerator.h"
#include "cmTargetExport.h"
-#include "cmGeneratorExpression.h"
//----------------------------------------------------------------------------
cmExportInstallFileGenerator
@@ -49,18 +48,6 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
if(this->ExportedTargets.insert(te->Target).second)
{
this->GenerateImportTargetCode(os, te->Target);
-
- ImportPropertyMap properties;
-
- if ((*tei)->Target->GetPolicyStatusCMP0019() == cmPolicies::NEW)
- {
- this->PopulateInterfaceProperty("INTERFACE_LINK_LIBRARIES",
- te->Target,
- cmGeneratorExpression::InstallInterface,
- properties);
- }
-
- this->GenerateInterfaceProperties(te->Target, os, properties);
}
else
{
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 2bcced1..32bf941 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -131,9 +131,15 @@ cmCompiledGeneratorExpression::~cmCompiledGeneratorExpression()
}
}
-//----------------------------------------------------------------------------
-static std::string stripAllGeneratorExpressions(const std::string &input)
+std::string cmGeneratorExpression::Preprocess(const std::string &input,
+ PreprocessContext context)
{
+ if (context != StripAllGeneratorExpressions)
+ {
+ assert(!"cmGeneratorExpression::Preprocess called with invalid args");
+ return std::string();
+ }
+
std::string result;
std::string::size_type pos = 0;
std::string::size_type lastPos = pos;
@@ -172,95 +178,3 @@ static std::string stripAllGeneratorExpressions(const std::string &input)
result += input.substr(lastPos);
return result;
}
-
-//----------------------------------------------------------------------------
-static std::string stripExportInterface(const std::string &input,
- cmGeneratorExpression::PreprocessContext context,
- const char *ns)
-{
- std::string result;
- {
- std::string::size_type pos = 0;
- std::string::size_type lastPos = pos;
- while((pos = input.find("$<BUILD_INTERFACE:", lastPos)) != input.npos
- || (pos = input.find("$<INSTALL_INTERFACE:", lastPos)) != input.npos)
- {
- result += input.substr(lastPos, pos - lastPos);
- const bool gotInstallInterface = input[pos + 2] == 'I';
- pos += gotInstallInterface ? sizeof("$<INSTALL_INTERFACE:") - 1
- : sizeof("$<BUILD_INTERFACE:") - 1;
- int nestingLevel = 1;
- const char *c = input.c_str() + pos;
- const char * const cStart = c;
- for ( ; *c; ++c)
- {
- if(c[0] == '$' && c[1] == '<')
- {
- ++nestingLevel;
- ++c;
- continue;
- }
- if(c[0] == '>')
- {
- --nestingLevel;
- if (nestingLevel != 0)
- {
- continue;
- }
- if(context == cmGeneratorExpression::BuildInterface
- && !gotInstallInterface)
- {
- result += input.substr(pos, c - cStart);
- }
- else if(context == cmGeneratorExpression::InstallInterface
- && gotInstallInterface)
- {
- result += input.substr(pos, c - cStart);
- }
- break;
- }
- }
- const std::string::size_type traversed = (c - cStart) + 1;
- if (!*c)
- {
- result += std::string(gotInstallInterface ? "$<INSTALL_INTERFACE:"
- : "$<BUILD_INTERFACE:")
- + input.substr(pos, traversed);
- }
- pos += traversed;
- lastPos = pos;
- }
- result += input.substr(lastPos);
- }
-
- {
- std::string::size_type pos = 0;
- std::string::size_type lastPos = pos;
-
- std::string expNs = ns ? ns : "";
- while((pos = result.find("$<EXPORT_NAMESPACE>", lastPos)) != input.npos)
- {
- result.replace(pos, sizeof("$<EXPORT_NAMESPACE>") - 1, expNs);
- pos += sizeof("$<EXPORT_NAMESPACE>") - 1;
- }
- }
- return result;
-}
-
-//----------------------------------------------------------------------------
-std::string cmGeneratorExpression::Preprocess(const std::string &input,
- PreprocessContext context,
- const char *ns)
-{
- if (context == StripAllGeneratorExpressions)
- {
- return stripAllGeneratorExpressions(input);
- }
- else if (context == BuildInterface || context == InstallInterface)
- {
- return stripExportInterface(input, context, ns);
- }
-
- assert(!"cmGeneratorExpression::Preprocess called with invalid args");
- return std::string();
-}
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 5e3352b..ea3e7d0 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -48,14 +48,11 @@ public:
const cmCompiledGeneratorExpression& Parse(const char* input);
enum PreprocessContext {
- StripAllGeneratorExpressions,
- BuildInterface,
- InstallInterface
+ StripAllGeneratorExpressions
};
static std::string Preprocess(const std::string &input,
- PreprocessContext context,
- const char *ns = 0);
+ PreprocessContext context);
private:
cmGeneratorExpression(const cmGeneratorExpression &);
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 07f46be..c609000 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -94,31 +94,6 @@ static const struct OneNode : public cmGeneratorExpressionNode
} oneNode;
//----------------------------------------------------------------------------
-static const struct OneNode buildInterfaceNode;
-
-//----------------------------------------------------------------------------
-static const struct ZeroNode installInterfaceNode;
-
-//----------------------------------------------------------------------------
-static const struct NullNode : public cmGeneratorExpressionNode
-{
- NullNode() {}
-
- virtual bool GeneratesContent() const { return false; }
-
- std::string Evaluate(const std::vector<std::string> &,
- cmGeneratorExpressionContext *,
- const GeneratorExpressionContent *,
- cmGeneratorExpressionDAGChecker *) const
- {
- return std::string();
- }
-
- virtual int NumExpectedParameters() const { return 0; }
-
-} nullNode;
-
-//----------------------------------------------------------------------------
#define BOOLEAN_OP_NODE(OPNAME, OP, SUCCESS_VALUE, FAILURE_VALUE) \
static const struct OP ## Node : public cmGeneratorExpressionNode \
{ \
@@ -616,12 +591,6 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
return &commaNode;
else if (identifier == "TARGET_PROPERTY")
return &targetPropertyNode;
- else if (identifier == "BUILD_INTERFACE")
- return &buildInterfaceNode;
- else if (identifier == "INSTALL_INTERFACE")
- return &installInterfaceNode;
- else if (identifier == "EXPORT_NAMESPACE")
- return &nullNode;
return 0;
}
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index d9bd803..6aef502 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -491,30 +491,6 @@ cmPolicies::cmPolicies()
"CMAKE_SHARED_LIBRARY_<Lang>_FLAGS whether it is modified or not and "
"honor the POSITION_INDEPENDENT_CODE target property.",
2,8,9,0, cmPolicies::WARN);
-
- this->DefinePolicy(
- CMP0019, "CMP0019",
- "Use INTERFACE_LINK_LIBRARIES instead of "
- "LINK_INTERFACE_LIBRARIES_<CONFIG>.",
- "CMake 2.8.10 used properties matching "
- "(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? "
- "to determine the link interface. CMake 2.8.11 and higher "
- "prefer instead to use the INTERFACE_LINK_LIBRARIES target property to "
- "determine the link interface, while ignoring properties matching"
- "(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? completely. The new "
- "INTERFACE_LINK_LIBRARIES target property can use generator expressions "
- "to specify config-specific link libraries."
- "\n"
- "The OLD behavior for this policy is to ignore the "
- "INTERFACE_LINK_LIBRARIES property for all targets and use the "
- "value of the appropriate property matching "
- "(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? instead."
- "\n"
- "The NEW behavior for this policy is to ignore "
- "the value of the property matching "
- "(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? and use "
- "INTERFACE_LINK_LIBRARIES instead.",
- 2,8,11,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index b6b8e39..6932565 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -68,7 +68,6 @@ public:
CMP0018, ///< Ignore language flags for shared libs, and adhere to
/// POSITION_INDEPENDENT_CODE property and *_COMPILE_OPTIONS_PI{E,C}
/// instead.
- CMP0019, ///< Use new-style INTERFACE_LINK_LIBRARIES
/** \brief Always the last entry.
*
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 50f74b9..be20464 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -21,7 +21,6 @@
#include "cmDocumentLocationUndefined.h"
#include "cmListFileCache.h"
#include "cmGeneratorExpression.h"
-#include "cmGeneratorExpressionDAGChecker.h"
#include <cmsys/RegularExpression.hxx>
#include <map>
#include <set>
@@ -128,7 +127,6 @@ cmTarget::cmTarget()
this->PolicyStatusCMP0003 = cmPolicies::WARN;
this->PolicyStatusCMP0004 = cmPolicies::WARN;
this->PolicyStatusCMP0008 = cmPolicies::WARN;
- this->PolicyStatusCMP0019 = cmPolicies::WARN;
this->LinkLibrariesAnalyzed = false;
this->HaveInstallRule = false;
this->DLLPlatform = false;
@@ -373,7 +371,7 @@ void cmTarget::DefineProperties(cmake *cm)
"imported library. "
"The list "
"should be disjoint from the list of interface libraries in the "
- "INTERFACE_LINK_LIBRARIES property. On platforms requiring "
+ "IMPORTED_LINK_INTERFACE_LIBRARIES property. On platforms requiring "
"dependent shared libraries to be found at link time CMake uses this "
"list to add appropriate files or paths to the link command line. "
"Ignored for non-imported targets.");
@@ -394,9 +392,7 @@ void cmTarget::DefineProperties(cmake *cm)
"The libraries will be included on the link line for the target. "
"Unlike the LINK_INTERFACE_LIBRARIES property, this property applies "
"to all imported target types, including STATIC libraries. "
- "This property is ignored for non-imported targets.\n"
- "This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead."
- );
+ "This property is ignored for non-imported targets.");
cm->DefineProperty
("IMPORTED_LINK_INTERFACE_LIBRARIES_<CONFIG>", cmProperty::TARGET,
@@ -404,8 +400,7 @@ void cmTarget::DefineProperties(cmake *cm)
"Configuration names correspond to those provided by the project "
"from which the target is imported. "
"If set, this property completely overrides the generic property "
- "for the named configuration."
- "This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.");
+ "for the named configuration.");
cm->DefineProperty
("IMPORTED_LINK_INTERFACE_LANGUAGES", cmProperty::TARGET,
@@ -705,8 +700,7 @@ void cmTarget::DefineProperties(cmake *cm)
"This property is initialized by the value of the variable "
"CMAKE_LINK_INTERFACE_LIBRARIES if it is set when a target is "
"created. "
- "This property is ignored for STATIC libraries."
- "This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.");
+ "This property is ignored for STATIC libraries.");
cm->DefineProperty
("LINK_INTERFACE_LIBRARIES_<CONFIG>", cmProperty::TARGET,
@@ -714,29 +708,7 @@ void cmTarget::DefineProperties(cmake *cm)
"This is the configuration-specific version of "
"LINK_INTERFACE_LIBRARIES. "
"If set, this property completely overrides the generic property "
- "for the named configuration."
- "This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.");
-
- cm->DefineProperty
- ("INTERFACE_LINK_LIBRARIES", cmProperty::TARGET,
- "List public interface libraries for a shared library or executable.",
- "By default linking to a shared library target transitively "
- "links to targets with which the library itself was linked. "
- "For an executable with exports (see the ENABLE_EXPORTS property) "
- "no default transitive link dependencies are used. "
- "This property replaces the default transitive link dependencies with "
- "an explicit list. "
- "When the target is linked into another target the libraries "
- "listed (and recursively their link interface libraries) will be "
- "provided to the other target also. "
- "If the list is empty then no transitive link dependencies will be "
- "incorporated when this target is linked into another target even if "
- "the default set is non-empty. "
- "This property is initialized by the value of the variable "
- "CMAKE_INTERFACE_LINK_LIBRARIES if it is set when a target is "
- "created. "
- "This property is ignored for STATIC libraries."
- CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS);
+ "for the named configuration.");
cm->DefineProperty
("LINK_INTERFACE_MULTIPLICITY", cmProperty::TARGET,
@@ -1376,7 +1348,6 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", 0);
this->SetPropertyDefault("LINK_DEPENDS_NO_SHARED", 0);
this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", 0);
- this->SetPropertyDefault("INTERFACE_LINK_LIBRARIES", 0);
this->SetPropertyDefault("WIN32_EXECUTABLE", 0);
this->SetPropertyDefault("MACOSX_BUNDLE", 0);
@@ -1438,8 +1409,6 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->Makefile->GetPolicyStatus(cmPolicies::CMP0004);
this->PolicyStatusCMP0008 =
this->Makefile->GetPolicyStatus(cmPolicies::CMP0008);
- this->PolicyStatusCMP0019 =
- this->Makefile->GetPolicyStatus(cmPolicies::CMP0019);
}
//----------------------------------------------------------------------------
@@ -4269,28 +4238,6 @@ cmTarget::GetImportInfo(const char* config)
return &i->second;
}
-
-bool handleCMP0019(const std::vector<std::string> &newLinkLibraries,
- const std::vector<std::string> &oldLinkLibraries)
-{
- if (newLinkLibraries.size() != oldLinkLibraries.size())
- {
- return false;
- }
- for(std::vector<std::string>::const_iterator
- oll = oldLinkLibraries.begin(), nll = newLinkLibraries.begin();
- oll != oldLinkLibraries.end() && nll != newLinkLibraries.end();
- ++oll, ++nll)
- {
- if (*oll != *nll)
- {
- return false;
- }
- }
- return true;
-}
-
-
//----------------------------------------------------------------------------
void cmTarget::ComputeImportInfo(std::string const& desired_config,
ImportInfo& info)
@@ -4494,49 +4441,21 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
// Get the link interface.
{
- std::vector<std::string> usedLinkLibraries;
-
- const char* newStyleLibsProp = this->GetProperty(
- "INTERFACE_LINK_LIBRARIES");
- if(newStyleLibsProp)
- {
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
-
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "INTERFACE_LINK_LIBRARIES", 0, 0);
- cmSystemTools::ExpandListArgument(ge.Parse(newStyleLibsProp)
- .Evaluate(this->Makefile,
- desired_config.c_str(),
- false,
- this,
- &dagChecker),
- usedLinkLibraries);
+ std::string linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES";
+ linkProp += suffix;
+ if(const char* config_libs = this->GetProperty(linkProp.c_str()))
+ {
+ cmSystemTools::ExpandListArgument(config_libs,
+ info.LinkInterface.Libraries);
}
- else
+ else if(const char* libs =
+ this->GetProperty("IMPORTED_LINK_INTERFACE_LIBRARIES"))
{
- std::string linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES";
- const char *oldProp = this->GetProperty((linkProp + suffix).c_str());
- if(oldProp)
- {
- linkProp += suffix;
- cmSystemTools::ExpandListArgument(oldProp, usedLinkLibraries);
- }
- else
- {
- oldProp = this->GetProperty("IMPORTED_LINK_INTERFACE_LIBRARIES");
- if(oldProp)
- {
- cmSystemTools::ExpandListArgument(oldProp, usedLinkLibraries);
- }
- }
+ cmSystemTools::ExpandListArgument(libs,
+ info.LinkInterface.Libraries);
}
- info.LinkInterface.Libraries.insert(info.LinkInterface.Libraries.end(),
- usedLinkLibraries.begin(), usedLinkLibraries.end());
}
-
// Get the link dependencies.
{
std::string linkProp = "IMPORTED_LINK_DEPENDENT_LIBRARIES";
@@ -4643,82 +4562,21 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface)
// An explicit list of interface libraries may be set for shared
// libraries and executables that export symbols.
- bool explicitLibraries = false;
- std::vector<std::string> usedLinkLibraries;
+ const char* explicitLibraries = 0;
if(this->GetType() == cmTarget::SHARED_LIBRARY ||
this->IsExecutableWithExports())
{
- const char *newLibrariesProp =
- this->GetProperty("INTERFACE_LINK_LIBRARIES");
-
- std::vector<std::string> newInterfaceLibs;
- std::vector<std::string> oldInterfaceLibs;
-
- if(newLibrariesProp)
- {
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
-
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "INTERFACE_LINK_LIBRARIES", 0, 0);
-
- cmSystemTools::ExpandListArgument(ge.Parse(newLibrariesProp).Evaluate(
- this->Makefile,
- config,
- false,
- this,
- &dagChecker), newInterfaceLibs);
- }
// Lookup the per-configuration property.
std::string propName = "LINK_INTERFACE_LIBRARIES";
propName += suffix;
- const char *oldLibrariesProp = this->GetProperty(propName.c_str());
+ explicitLibraries = this->GetProperty(propName.c_str());
// If not set, try the generic property.
- if(!oldLibrariesProp)
- {
- oldLibrariesProp = this->GetProperty("LINK_INTERFACE_LIBRARIES");
- }
- if(oldLibrariesProp)
- {
- cmSystemTools::ExpandListArgument(oldLibrariesProp, oldInterfaceLibs);
- }
-
- {
- switch (this->PolicyStatusCMP0019)
+ if(!explicitLibraries)
{
- case cmPolicies::WARN:
- {
- if (newLibrariesProp && oldLibrariesProp
- && !handleCMP0019(newInterfaceLibs, oldInterfaceLibs))
- {
- cmOStringStream e;
- e << "The INTERFACE_LINK_LIBRARIES and LINK_INTERFACE_LIBRARIES are "
- "not the same for target \"" << this->GetName() << "\".\n"
- "NEW content is \""
- << (newLibrariesProp ? newLibrariesProp : "(unset)") << "\"\n"
- "OLD content is \""
- << (oldLibrariesProp ? oldLibrariesProp : "(unset)") << "\"\n"
- << this->Makefile->GetPolicies()->GetPolicyWarning(
- cmPolicies::CMP0019);
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
- }
- // fall through to OLD behaviour
- }
- case cmPolicies::OLD:
- explicitLibraries = oldLibrariesProp ? true : false;
- usedLinkLibraries = oldInterfaceLibs;
- break;
- case cmPolicies::REQUIRED_IF_USED:
- case cmPolicies::REQUIRED_ALWAYS:
- case cmPolicies::NEW:
- default:
- usedLinkLibraries = newInterfaceLibs;
- explicitLibraries = newLibrariesProp ? true : false;
+ explicitLibraries = this->GetProperty("LINK_INTERFACE_LIBRARIES");
}
}
- }
// There is no implicit link interface for executables or modules
// so if none was explicitly set then there is no link interface.
@@ -4734,8 +4592,7 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface)
if(explicitLibraries)
{
// The interface libraries have been explicitly set.
- iface.Libraries.insert(iface.Libraries.end(),
- usedLinkLibraries.begin(), usedLinkLibraries.end());
+ cmSystemTools::ExpandListArgument(explicitLibraries, iface.Libraries);
if(this->GetType() == cmTarget::SHARED_LIBRARY)
{
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 7c55933..9efd638 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -99,10 +99,6 @@ public:
cmPolicies::PolicyStatus GetPolicyStatusCMP0008() const
{ return this->PolicyStatusCMP0008; }
- /** Get the status of policy CMP0019 when the target was created. */
- cmPolicies::PolicyStatus GetPolicyStatusCMP0019() const
- { return this->PolicyStatusCMP0019; }
-
/**
* Get the list of the custom commands for this target
*/
@@ -622,7 +618,6 @@ private:
cmPolicies::PolicyStatus PolicyStatusCMP0003;
cmPolicies::PolicyStatus PolicyStatusCMP0004;
cmPolicies::PolicyStatus PolicyStatusCMP0008;
- cmPolicies::PolicyStatus PolicyStatusCMP0019;
// Internal representation details.
friend class cmTargetInternals;
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index d7a1443..f42b0f6 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -232,11 +232,7 @@ bool cmTargetLinkLibrariesCommand
{
this->Target->SetProperty("LINK_INTERFACE_LIBRARIES", "");
}
- if(this->CurrentProcessingState != ProcessingLinkLibraries &&
- !this->Target->GetProperty("INTERFACE_LINK_LIBRARIES"))
- {
- this->Target->SetProperty("INTERFACE_LINK_LIBRARIES", "");
- }
+
return true;
}
@@ -254,25 +250,6 @@ cmTargetLinkLibrariesCommand
}
//----------------------------------------------------------------------------
-static std::string generatorIface(const std::string &value,
- cmTarget::LinkLibraryType llt)
-{
- if (llt == cmTarget::DEBUG)
- {
- return "$<$<CONFIG:Debug>:"
- + value
- + ">";
- }
- else if (llt == cmTarget::OPTIMIZED)
- {
- return "$<$<NOT:$<CONFIG:Debug>>:"
- + value
- + ">";
- }
- return value;
-}
-
-//----------------------------------------------------------------------------
void
cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
cmTarget::LinkLibraryType llt)
@@ -289,9 +266,6 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
}
}
- this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
- generatorIface(lib, llt).c_str());
-
// Get the list of configurations considered to be DEBUG.
std::vector<std::string> const& debugConfigs =
this->Makefile->GetCMakeInstance()->GetDebugConfigs();
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 95cfd15..1faa888 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -56,21 +56,3 @@ assert_property(targetA LINK_INTERFACE_LIBRARIES "")
target_link_libraries(targetA depB depC)
assert_property(targetA LINK_INTERFACE_LIBRARIES "")
-
-# cmake_policy(PUSH)
-
-cmake_policy(SET CMP0019 NEW)
-
-add_library(depD SHARED depD.cpp)
-generate_export_header(depD)
-set_property(TARGET depD APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<1:depA>)
-
-add_library(depE SHARED depE.cpp)
-generate_export_header(depE)
-target_link_libraries(depE LINK_PRIVATE depB)
-target_link_libraries(depE LINK_INTERFACE_LIBRARIES $<1:depB>)
-
-add_executable(targetB targetB.cpp)
-target_link_libraries(targetB depD depE)
-
-# cmake_policy(POP)
diff --git a/Tests/CMakeCommands/target_link_libraries/depD.cpp b/Tests/CMakeCommands/target_link_libraries/depD.cpp
deleted file mode 100644
index b02c76c..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depD.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#include "depD.h"
-
-int DepD::foo()
-{
- return 0;
-}
-
-DepA DepD::getA()
-{
- DepA a;
- return a;
-}
diff --git a/Tests/CMakeCommands/target_link_libraries/depD.h b/Tests/CMakeCommands/target_link_libraries/depD.h
deleted file mode 100644
index d24ff5f..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depD.h
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#include "depd_export.h"
-
-#include "depA.h"
-
-struct DEPD_EXPORT DepD
-{
- int foo();
-
- DepA getA();
-};
diff --git a/Tests/CMakeCommands/target_link_libraries/depE.cpp b/Tests/CMakeCommands/target_link_libraries/depE.cpp
deleted file mode 100644
index 1a3da4a..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depE.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#include "depE.h"
-
-int DepE::foo()
-{
- return 0;
-}
-
-DepB DepE::getB()
-{
- DepB a;
- return a;
-}
diff --git a/Tests/CMakeCommands/target_link_libraries/depE.h b/Tests/CMakeCommands/target_link_libraries/depE.h
deleted file mode 100644
index 2273e17..0000000
--- a/Tests/CMakeCommands/target_link_libraries/depE.h
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#include "depe_export.h"
-
-#include "depB.h"
-
-struct DEPE_EXPORT DepE
-{
- int foo();
-
- DepB getB();
-};
diff --git a/Tests/CMakeCommands/target_link_libraries/targetB.cpp b/Tests/CMakeCommands/target_link_libraries/targetB.cpp
deleted file mode 100644
index c6a1264..0000000
--- a/Tests/CMakeCommands/target_link_libraries/targetB.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#include "depD.h"
-#include "depE.h"
-
-int main(int argc, char **argv)
-{
- DepD d;
- DepA a = d.getA();
-
- DepE e;
- DepB b = e.getB();
-
- return d.foo() + a.foo() + e.foo() + b.foo();
-}
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 66c190a..3a92d81 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 2.8.8)
project(GeneratorExpression NONE)
-add_custom_target(check-part1 ALL
+add_custom_target(check ALL
COMMAND ${CMAKE_COMMAND}
-Dtest_0=$<0:nothing>
-Dtest_0_with_comma=$<0:-Wl,--no-undefined>
@@ -57,13 +57,6 @@ add_custom_target(check-part1 ALL
-Dtest_colons_3=$<1:Qt5::Core>
-Dtest_colons_4=$<1:C:\\CMake>
-Dtest_colons_5=$<1:C:/CMake>
- -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part1.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 1 of 2)"
- VERBATIM
- )
-
-add_custom_target(check-part2 ALL
- COMMAND ${CMAKE_COMMAND}
-Dtest_incomplete_1=$<
-Dtest_incomplete_2=$<something
-Dtest_incomplete_3=$<something:
@@ -85,10 +78,7 @@ add_custom_target(check-part2 ALL
-Dtest_incomplete_19=$<1:some,thing$<ANGLE-R>
-Dtest_incomplete_20=$<CONFIGURATION$<ANGLE-R>
-Dtest_incomplete_21=$<BOOL:something$<ANGLE-R>
- -Dtest_build_interface=$<BUILD_INTERFACE:build>
- -Dtest_install_interface=$<INSTALL_INTERFACE:install>
- -Dtest_export_namespace=$<EXPORT_NAMESPACE>x
- -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part2.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 2)"
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake
+ COMMAND ${CMAKE_COMMAND} -E echo "check done"
VERBATIM
)
diff --git a/Tests/GeneratorExpression/check-common.cmake b/Tests/GeneratorExpression/check-common.cmake
deleted file mode 100644
index 8ffebd7..0000000
--- a/Tests/GeneratorExpression/check-common.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-macro(check var val)
- if(NOT "${${var}}" STREQUAL "${val}")
- message(SEND_ERROR "${var} is \"${${var}}\", not \"${val}\"")
- endif()
-endmacro()
diff --git a/Tests/GeneratorExpression/check-part1.cmake b/Tests/GeneratorExpression/check-part1.cmake
deleted file mode 100644
index 7abfa82..0000000
--- a/Tests/GeneratorExpression/check-part1.cmake
+++ /dev/null
@@ -1,56 +0,0 @@
-
-include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake)
-
-message(STATUS "config=[${config}]")
-check(test_0 "")
-check(test_0_with_comma "")
-check(test_1 "content")
-check(test_1_with_comma "-Wl,--no-undefined")
-check(test_and_0 "0")
-check(test_and_0_0 "0")
-check(test_and_0_1 "0")
-check(test_and_1 "1")
-check(test_and_1_0 "0")
-check(test_and_1_1 "1")
-check(test_and_0_invalidcontent "0")
-check(test_config_0 "0")
-check(test_config_1 "1")
-foreach(c debug release relwithdebinfo minsizerel)
- if(NOT "${test_config_${c}}" MATCHES "^(0+|1+)$")
- message(SEND_ERROR "test_config_${c} is \"${test_config_${c}}\", not all 0 or all 1")
- endif()
-endforeach()
-check(test_not_0 "1")
-check(test_not_1 "0")
-check(test_or_0 "0")
-check(test_or_0_0 "0")
-check(test_or_0_1 "1")
-check(test_or_1 "1")
-check(test_or_1_0 "1")
-check(test_or_1_1 "1")
-check(test_or_1_invalidcontent "1")
-check(test_bool_notfound "0")
-check(test_bool_foo_notfound "0")
-check(test_bool_true "1")
-check(test_bool_false "0")
-check(test_bool_on "1")
-check(test_bool_off "0")
-check(test_bool_no "0")
-check(test_bool_n "0")
-check(test_bool_empty "0")
-check(test_strequal_yes_yes "1")
-check(test_strequal_yes_yes_cs "0")
-check(test_strequal_yes_no "0")
-check(test_strequal_no_yes "0")
-check(test_strequal_angle_r "1")
-check(test_strequal_comma "1")
-check(test_strequal_angle_r_comma "0")
-check(test_strequal_both_empty "1")
-check(test_strequal_one_empty "0")
-check(test_angle_r ">")
-check(test_comma ",")
-check(test_colons_1 ":")
-check(test_colons_2 "::")
-check(test_colons_3 "Qt5::Core")
-check(test_colons_4 "C:\\\\CMake")
-check(test_colons_5 "C:/CMake")
diff --git a/Tests/GeneratorExpression/check-part2.cmake b/Tests/GeneratorExpression/check-part2.cmake
deleted file mode 100644
index 4201345..0000000
--- a/Tests/GeneratorExpression/check-part2.cmake
+++ /dev/null
@@ -1,27 +0,0 @@
-
-include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake)
-
-check(test_incomplete_1 "$<")
-check(test_incomplete_2 "$<something")
-check(test_incomplete_3 "$<something:")
-check(test_incomplete_4 "$<something:,")
-check(test_incomplete_5 "$something:,>")
-check(test_incomplete_6 "<something:,>")
-check(test_incomplete_7 "$<something::")
-check(test_incomplete_8 "$<something:,")
-check(test_incomplete_9 "$<something:,,")
-check(test_incomplete_10 "$<something:,:")
-check(test_incomplete_11 "$<something,,")
-check(test_incomplete_12 "$<,,")
-check(test_incomplete_13 "$<somespecialthing")
-check(test_incomplete_14 "$<>")
-check(test_incomplete_15 "$<some$<thing")
-check(test_incomplete_16 "$<BOOL:something")
-check(test_incomplete_17 "some$thing")
-check(test_incomplete_18 "$<1:some,thing")
-check(test_incomplete_19 "$<1:some,thing>")
-check(test_incomplete_20 "$<CONFIGURATION>")
-check(test_incomplete_21 "$<BOOL:something>")
-check(test_build_interface "build")
-check(test_install_interface "")
-check(test_export_namespace "x")
diff --git a/Tests/GeneratorExpression/check.cmake b/Tests/GeneratorExpression/check.cmake
new file mode 100644
index 0000000..af436de
--- /dev/null
+++ b/Tests/GeneratorExpression/check.cmake
@@ -0,0 +1,80 @@
+macro(check var val)
+ if(NOT "${${var}}" STREQUAL "${val}")
+ message(SEND_ERROR "${var} is \"${${var}}\", not \"${val}\"")
+ endif()
+endmacro()
+
+message(STATUS "config=[${config}]")
+check(test_0 "")
+check(test_0_with_comma "")
+check(test_1 "content")
+check(test_1_with_comma "-Wl,--no-undefined")
+check(test_and_0 "0")
+check(test_and_0_0 "0")
+check(test_and_0_1 "0")
+check(test_and_1 "1")
+check(test_and_1_0 "0")
+check(test_and_1_1 "1")
+check(test_and_0_invalidcontent "0")
+check(test_config_0 "0")
+check(test_config_1 "1")
+foreach(c debug release relwithdebinfo minsizerel)
+ if(NOT "${test_config_${c}}" MATCHES "^(0+|1+)$")
+ message(SEND_ERROR "test_config_${c} is \"${test_config_${c}}\", not all 0 or all 1")
+ endif()
+endforeach()
+check(test_not_0 "1")
+check(test_not_1 "0")
+check(test_or_0 "0")
+check(test_or_0_0 "0")
+check(test_or_0_1 "1")
+check(test_or_1 "1")
+check(test_or_1_0 "1")
+check(test_or_1_1 "1")
+check(test_or_1_invalidcontent "1")
+check(test_bool_notfound "0")
+check(test_bool_foo_notfound "0")
+check(test_bool_true "1")
+check(test_bool_false "0")
+check(test_bool_on "1")
+check(test_bool_off "0")
+check(test_bool_no "0")
+check(test_bool_n "0")
+check(test_bool_empty "0")
+check(test_strequal_yes_yes "1")
+check(test_strequal_yes_yes_cs "0")
+check(test_strequal_yes_no "0")
+check(test_strequal_no_yes "0")
+check(test_strequal_angle_r "1")
+check(test_strequal_comma "1")
+check(test_strequal_angle_r_comma "0")
+check(test_strequal_both_empty "1")
+check(test_strequal_one_empty "0")
+check(test_angle_r ">")
+check(test_comma ",")
+check(test_colons_1 ":")
+check(test_colons_2 "::")
+check(test_colons_3 "Qt5::Core")
+check(test_colons_4 "C:\\\\CMake")
+check(test_colons_5 "C:/CMake")
+check(test_incomplete_1 "$<")
+check(test_incomplete_2 "$<something")
+check(test_incomplete_3 "$<something:")
+check(test_incomplete_4 "$<something:,")
+check(test_incomplete_5 "$something:,>")
+check(test_incomplete_6 "<something:,>")
+check(test_incomplete_7 "$<something::")
+check(test_incomplete_8 "$<something:,")
+check(test_incomplete_9 "$<something:,,")
+check(test_incomplete_10 "$<something:,:")
+check(test_incomplete_11 "$<something,,")
+check(test_incomplete_12 "$<,,")
+check(test_incomplete_13 "$<somespecialthing")
+check(test_incomplete_14 "$<>")
+check(test_incomplete_15 "$<some$<thing")
+check(test_incomplete_16 "$<BOOL:something")
+check(test_incomplete_17 "some$thing")
+check(test_incomplete_18 "$<1:some,thing")
+check(test_incomplete_19 "$<1:some,thing>")
+check(test_incomplete_20 "$<CONFIGURATION>")
+check(test_incomplete_21 "$<BOOL:something>")
-----------------------------------------------------------------------
Summary of changes:
Source/cmComputeTargetDepends.cxx | 36 +--
Source/cmCustomCommandGenerator.cxx | 4 +-
Source/cmDocumentGeneratorExpressions.h | 10 -
Source/cmDocumentVariables.cxx | 8 -
Source/cmExportBuildFileGenerator.cxx | 18 -
Source/cmExportFileGenerator.cxx | 44 --
Source/cmExportFileGenerator.h | 7 -
Source/cmExportInstallFileGenerator.cxx | 21 -
Source/cmGeneratorExpression.cxx | 148 ++-----
Source/cmGeneratorExpression.h | 31 +-
Source/cmGeneratorExpressionEvaluator.cxx | 78 +---
Source/cmGeneratorTarget.cxx | 42 ++-
Source/cmGlobalXCodeGenerator.cxx | 3 +-
Source/cmMakefile.cxx | 10 +-
Source/cmMakefileTargetGenerator.cxx | 3 +-
Source/cmPolicies.cxx | 41 --
Source/cmPolicies.h | 2 -
Source/cmTarget.cxx | 494 ++------------------
Source/cmTarget.h | 17 +-
Source/cmTargetLinkLibrariesCommand.cxx | 76 +---
Source/cmTestGenerator.cxx | 4 +-
.../target_link_libraries/CMakeLists.txt | 46 +--
Tests/CMakeCommands/target_link_libraries/depD.cpp | 13 -
Tests/CMakeCommands/target_link_libraries/depD.h | 11 -
Tests/CMakeCommands/target_link_libraries/depE.cpp | 13 -
Tests/CMakeCommands/target_link_libraries/depE.h | 11 -
Tests/CMakeCommands/target_link_libraries/depF.cpp | 7 -
Tests/CMakeCommands/target_link_libraries/depF.h | 7 -
.../target_link_libraries/targetB.cpp | 14 -
.../target_link_libraries/targetC.cpp | 16 -
Tests/GeneratorExpression/CMakeLists.txt | 16 +-
Tests/GeneratorExpression/check-common.cmake | 5 -
Tests/GeneratorExpression/check-part1.cmake | 56 ---
Tests/GeneratorExpression/check-part2.cmake | 27 --
Tests/GeneratorExpression/check.cmake | 80 ++++
.../TargetIncludeDirectories/CMakeLists.txt | 20 -
36 files changed, 236 insertions(+), 1203 deletions(-)
delete mode 100644 Tests/CMakeCommands/target_link_libraries/depD.cpp
delete mode 100644 Tests/CMakeCommands/target_link_libraries/depD.h
delete mode 100644 Tests/CMakeCommands/target_link_libraries/depE.cpp
delete mode 100644 Tests/CMakeCommands/target_link_libraries/depE.h
delete mode 100644 Tests/CMakeCommands/target_link_libraries/depF.cpp
delete mode 100644 Tests/CMakeCommands/target_link_libraries/depF.h
delete mode 100644 Tests/CMakeCommands/target_link_libraries/targetB.cpp
delete mode 100644 Tests/CMakeCommands/target_link_libraries/targetC.cpp
delete mode 100644 Tests/GeneratorExpression/check-common.cmake
delete mode 100644 Tests/GeneratorExpression/check-part1.cmake
delete mode 100644 Tests/GeneratorExpression/check-part2.cmake
create mode 100644 Tests/GeneratorExpression/check.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list