[Cmake-commits] CMake branch, next, updated. v2.8.11-2324-g8bd932f
Stephen Kelly
steveire at gmail.com
Thu May 30 06:38:01 EDT 2013
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 8bd932fabb2584c060ac654f643283cb4ff7a84e (commit)
via 79cde5b76eecaaa1644e12c9ca56fe10750e969b (commit)
from 764f383fcf6544b3dff151b51853702e51dae717 (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=8bd932fabb2584c060ac654f643283cb4ff7a84e
commit 8bd932fabb2584c060ac654f643283cb4ff7a84e
Merge: 764f383 79cde5b
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu May 30 06:38:00 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu May 30 06:38:00 2013 -0400
Merge topic 'fix-INCLUDE_DIRECTORIES-genex-read' into next
79cde5b GenexEval: Fix evaluation of INCLUDE_DIRECTORIES target property.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79cde5b76eecaaa1644e12c9ca56fe10750e969b
commit 79cde5b76eecaaa1644e12c9ca56fe10750e969b
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed May 29 00:34:30 2013 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu May 30 12:37:28 2013 +0200
GenexEval: Fix evaluation of INCLUDE_DIRECTORIES target property.
This property should come from the content of the property itself,
plus the INTERFACE_INCLUDE_DIRECTORIES of the link *implementation*.
In contrast, when the INTERFACE_INCLUDE_DIRECTORIES is evaluated for
a target, the INTERFACE_INCLUDE_DIRECTORIES of the link *interface*
is used.
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 3a8aaae..d076cc1 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -399,6 +399,48 @@ static const char* targetPropertyTransitiveWhitelist[] = {
, "INTERFACE_COMPILE_DEFINITIONS"
};
+std::string getLinkedTargetsContent(const std::vector<std::string> &libraries,
+ cmTarget *target,
+ cmGeneratorExpressionContext *context,
+ cmGeneratorExpressionDAGChecker *dagChecker,
+ const std::string &interfacePropertyName)
+{
+ cmGeneratorExpression ge(context->Backtrace);
+
+ std::string sep;
+ std::string depString;
+ for (std::vector<std::string>::const_iterator
+ it = libraries.begin();
+ it != libraries.end(); ++it)
+ {
+ if (*it == target->GetName())
+ {
+ // Broken code can have a target in its own link interface.
+ // Don't follow such link interface entries so as not to create a
+ // self-referencing loop.
+ continue;
+ }
+ if (context->Makefile->FindTargetToUse(it->c_str()))
+ {
+ depString +=
+ sep + "$<TARGET_PROPERTY:" + *it + "," + interfacePropertyName + ">";
+ sep = ";";
+ }
+ }
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(depString);
+ std::string linkedTargetsContent = cge->Evaluate(context->Makefile,
+ context->Config,
+ context->Quiet,
+ context->HeadTarget,
+ target,
+ dagChecker);
+ if (cge->GetHadContextSensitiveCondition())
+ {
+ context->HadContextSensitiveCondition = true;
+ }
+ return linkedTargetsContent;
+}
+
//----------------------------------------------------------------------------
struct TransitiveWhitelistCompare
{
@@ -588,48 +630,31 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
+ (sizeof(targetPropertyTransitiveWhitelist) /
sizeof(*targetPropertyTransitiveWhitelist));
if (std::find_if(transBegin, transEnd,
- TransitiveWhitelistCompare(interfacePropertyName)) != transEnd)
+ TransitiveWhitelistCompare(propertyName)) != transEnd)
{
const cmTarget::LinkInterface *iface = target->GetLinkInterface(
context->Config,
context->HeadTarget);
if(iface)
{
- cmGeneratorExpression ge(context->Backtrace);
-
- std::string sep;
- std::string depString;
- for (std::vector<std::string>::const_iterator
- it = iface->Libraries.begin();
- it != iface->Libraries.end(); ++it)
- {
- if (*it == target->GetName())
- {
- // Broken code can have a target in its own link interface.
- // Don't follow such link interface entries so as not to create a
- // self-referencing loop.
- continue;
- }
- if (context->Makefile->FindTargetToUse(it->c_str()))
- {
- depString +=
- sep + "$<TARGET_PROPERTY:" + *it + ","
- + interfacePropertyName + ">";
- sep = ";";
- }
- }
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(depString);
- linkedTargetsContent = cge->Evaluate(context->Makefile,
- context->Config,
- context->Quiet,
- context->HeadTarget,
- target,
- &dagChecker);
- if (cge->GetHadContextSensitiveCondition())
- {
- context->HadContextSensitiveCondition = true;
- }
+ linkedTargetsContent =
+ getLinkedTargetsContent(iface->Libraries, target,
+ context, &dagChecker,
+ interfacePropertyName);
+ }
+ }
+ else if (std::find_if(transBegin, transEnd,
+ TransitiveWhitelistCompare(interfacePropertyName)) != transEnd)
+ {
+ const cmTarget::LinkImplementation *impl = target->GetLinkImplementation(
+ context->Config,
+ context->HeadTarget);
+ if(impl)
+ {
+ linkedTargetsContent =
+ getLinkedTargetsContent(impl->Libraries, target,
+ context, &dagChecker,
+ interfacePropertyName);
}
}
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
index 50f12ee..e9dd4df 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -144,3 +144,21 @@ set_property(TARGET TargetIncludeDirectories_C
"$<$<LINK_LANGUAGE:C>:${CMAKE_CURRENT_BINARY_DIR}/good>"
"$<$<STREQUAL:$<LINK_LANGUAGE>,C>:${CMAKE_CURRENT_BINARY_DIR}/othergood/>"
)
+
+add_library(includes_source_good ../empty.cpp)
+target_include_directories(includes_source_good
+ INTERFACE
+ "${CMAKE_CURRENT_BINARY_DIR}/good"
+ "${CMAKE_CURRENT_BINARY_DIR}/othergood/"
+)
+add_library(includes_source_bad ../empty.cpp)
+target_include_directories(includes_source_bad
+ INTERFACE
+ "${CMAKE_CURRENT_BINARY_DIR}/bad"
+)
+
+add_library(includes_proxy SHARED ../empty.cpp)
+target_link_libraries(includes_proxy includes_source_good)
+target_link_libraries(includes_proxy LINK_INTERFACE_LIBRARIES includes_source_bad)
+add_executable(copy_includes copy_includes.cpp)
+target_include_directories(copy_includes PRIVATE $<TARGET_PROPERTY:includes_proxy,INCLUDE_DIRECTORIES>)
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/copy_includes.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/copy_includes.cpp
new file mode 100644
index 0000000..fed4c03
--- /dev/null
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/copy_includes.cpp
@@ -0,0 +1,7 @@
+
+#include "common.h"
+
+int main()
+{
+ return 0;
+}
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list