[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2300-g0e40f07
Stephen Kelly
steveire at gmail.com
Fri Feb 22 09:32:01 EST 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 0e40f0768ba409bd68b689038c3084e5c91c22d3 (commit)
via 08a9eeab60fe5328aa76ac8789e9a51396f97e6f (commit)
via 880a7794ece7a7ba11f2e8461ee15029b1f5071f (commit)
via a10539b91bcd832c51bc8549e000d530d67de4cb (commit)
from cdb5bd4b4fb942b33436635ff50ece0c4b346e10 (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=0e40f0768ba409bd68b689038c3084e5c91c22d3
commit 0e40f0768ba409bd68b689038c3084e5c91c22d3
Merge: cdb5bd4 08a9eea
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Feb 22 09:31:59 2013 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Feb 22 09:31:59 2013 -0500
Merge topic 'interface-property-external-read' into next
08a9eea Fix the tests for evaluating includes and defines.
880a779 Fix constness of accessors.
a10539b Expand includes and defines transitively in 'external' genexes.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08a9eeab60fe5328aa76ac8789e9a51396f97e6f
commit 08a9eeab60fe5328aa76ac8789e9a51396f97e6f
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Feb 18 10:42:00 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Feb 22 15:29:25 2013 +0100
Fix the tests for evaluating includes and defines.
We should also check whether the INTERFACE_ variant of a property
is being read, and in the case of the compile definitions, we should
test the _<CONFIG> suffixed variants. That is already available
through the use of the methods.
This way, we use the ALREADY_SEEN optimization when evaluating
the includes of a target in 'external' generator expressions, ie, those
used in a add_custom_command invokation, as opposed to evaluating the
INCLUDE_DIRECTORIES of a target itself via GetIncludeDirectories.
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index f8776d9..5cb50b9 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -33,8 +33,8 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
}
this->CheckResult = this->checkGraph();
- if (CheckResult == DAG && (top->Property == "INCLUDE_DIRECTORIES"
- || top->Property == "COMPILE_DEFINITIONS") )
+ if (CheckResult == DAG && (top->EvaluatingIncludeDirectories()
+ || top->EvaluatingCompileDefinitions()))
{
std::map<cmStdString, std::set<cmStdString> >::const_iterator it
= top->Seen.find(target);
diff --git a/Tests/GeneratorExpression/check-part2.cmake b/Tests/GeneratorExpression/check-part2.cmake
index 44ded62..3f7187c 100644
--- a/Tests/GeneratorExpression/check-part2.cmake
+++ b/Tests/GeneratorExpression/check-part2.cmake
@@ -26,11 +26,11 @@ check(test_build_interface "build")
check(test_install_interface "")
check(test_target_name_1 "tgt,ok")
check(test_target_name_2 "tgt:ok")
-check(test_target_includes1 "/empty1/public;/empty2/public;/empty3/public;/empty4/public;/empty4/public")
-check(test_target_includes2 "/empty2/public;/empty3/public;/empty4/public;/empty4/public")
-check(test_target_includes3 "/empty3/public;/empty2/public;/empty4/public;/empty4/public")
+check(test_target_includes1 "/empty1/public;/empty2/public;/empty3/public;/empty4/public")
+check(test_target_includes2 "/empty2/public;/empty3/public;/empty4/public")
+check(test_target_includes3 "/empty3/public;/empty2/public;/empty4/public")
check(test_target_includes4 "/empty1/public;/empty1/private;/empty2/public;/empty3/public;/empty4/public")
check(test_target_includes5 "/empty2/public;/empty3/public;/empty2/public;/empty4/public")
check(test_target_includes6 "/empty3/public;/empty3/private;/empty2/public;/empty3/public;/empty4/public")
-check(test_target_includes7 "/empty1/public;/empty2/public;/empty3/public;/empty4/public;/empty4/public")
+check(test_target_includes7 "/empty1/public;/empty2/public;/empty3/public;/empty4/public")
check(test_target_includes8 "/empty5/private1;/empty5/private2")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=880a7794ece7a7ba11f2e8461ee15029b1f5071f
commit 880a7794ece7a7ba11f2e8461ee15029b1f5071f
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Feb 18 10:34:16 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Feb 22 15:29:25 2013 +0100
Fix constness of accessors.
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 2d50c25..f8776d9 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -153,7 +153,7 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries()
}
//----------------------------------------------------------------------------
-bool cmGeneratorExpressionDAGChecker::EvaluatingIncludeDirectories()
+bool cmGeneratorExpressionDAGChecker::EvaluatingIncludeDirectories() const
{
const char *prop = this->Property.c_str();
return (strcmp(prop, "INCLUDE_DIRECTORIES") == 0
@@ -161,7 +161,7 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingIncludeDirectories()
}
//----------------------------------------------------------------------------
-bool cmGeneratorExpressionDAGChecker::EvaluatingCompileDefinitions()
+bool cmGeneratorExpressionDAGChecker::EvaluatingCompileDefinitions() const
{
const char *prop = this->Property.c_str();
return (strcmp(prop, "COMPILE_DEFINITIONS") == 0
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index a2e5ce4..62a5cdf 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -38,8 +38,8 @@ struct cmGeneratorExpressionDAGChecker
const std::string &expr);
bool EvaluatingLinkLibraries();
- bool EvaluatingIncludeDirectories();
- bool EvaluatingCompileDefinitions();
+ bool EvaluatingIncludeDirectories() const;
+ bool EvaluatingCompileDefinitions() const;
private:
Result checkGraph() const;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a10539b91bcd832c51bc8549e000d530d67de4cb
commit a10539b91bcd832c51bc8549e000d530d67de4cb
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 13 12:35:31 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Feb 22 15:27:35 2013 +0100
Expand includes and defines transitively in 'external' genexes.
This means that we can use expressions of the form
$<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES>
to get a list of the interface include directories of foo, including
those coming from dependencies.
We can't have a test of a target which has a single include directory in
its INCLUDE_DIRECTORIES because the shell on the MSYS platforms transforms
a single include directory to include a prefix, which is not what the test
expects. We test a target with two directories instead as a means to
test a target with no link dependencies.
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 7de35d1..c294425 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -458,8 +458,6 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
const char *prop = target->GetProperty(propertyName.c_str());
- std::string linkedTargetsContent;
-
if (dagCheckerParent)
{
if (dagCheckerParent->EvaluatingLinkLibraries())
@@ -473,44 +471,61 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
{
assert(dagCheckerParent->EvaluatingIncludeDirectories()
|| dagCheckerParent->EvaluatingCompileDefinitions());
+ }
+ }
+
+ std::string linkedTargetsContent;
+
+ std::string interfacePropertyName;
- if (propertyName == "INTERFACE_INCLUDE_DIRECTORIES"
- || propertyName == "INTERFACE_COMPILE_DEFINITIONS")
+ if (propertyName == "INTERFACE_INCLUDE_DIRECTORIES"
+ || propertyName == "INCLUDE_DIRECTORIES")
+ {
+ interfacePropertyName = "INTERFACE_INCLUDE_DIRECTORIES";
+ }
+ else if (propertyName == "INTERFACE_COMPILE_DEFINITIONS"
+ || propertyName == "COMPILE_DEFINITIONS"
+ || strncmp(propertyName.c_str(), "COMPILE_DEFINITIONS_", 20) == 0)
+ {
+ interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS";
+ }
+
+ if (interfacePropertyName == "INTERFACE_INCLUDE_DIRECTORIES"
+ || interfacePropertyName == "INTERFACE_COMPILE_DEFINITIONS")
+ {
+ 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)
{
- const cmTarget::LinkInterface *iface = target->GetLinkInterface(
- context->Config,
- context->HeadTarget);
- if(iface)
+ if (context->Makefile->FindTargetToUse(it->c_str()))
{
- 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 (context->Makefile->FindTargetToUse(it->c_str()))
- {
- depString +=
- sep + "$<TARGET_PROPERTY:" + *it + "," + propertyName + ">";
- 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;
- }
+ 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;
+ }
}
}
@@ -550,7 +565,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
sizeof(*targetPropertyTransitiveWhitelist));
++i)
{
- if (targetPropertyTransitiveWhitelist[i] == propertyName)
+ if (targetPropertyTransitiveWhitelist[i] == interfacePropertyName)
{
cmGeneratorExpression ge(context->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index ecbbedf..fff7c87 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 2.8.8)
-project(GeneratorExpression NONE)
+project(GeneratorExpression CXX)
add_custom_target(check-part1 ALL
COMMAND ${CMAKE_COMMAND}
@@ -62,6 +62,27 @@ add_custom_target(check-part1 ALL
VERBATIM
)
+add_library(empty1 empty.cpp)
+target_include_directories(empty1 PUBLIC /empty1/public)
+target_include_directories(empty1 PRIVATE /empty1/private)
+
+add_library(empty2 empty.cpp)
+target_include_directories(empty2 PUBLIC /empty2/public)
+
+add_library(empty3 empty.cpp)
+target_include_directories(empty3 PUBLIC /empty3/public)
+target_include_directories(empty3 PRIVATE /empty3/private)
+
+add_library(empty4 empty.cpp)
+target_include_directories(empty4 PUBLIC /empty4/public)
+
+target_link_libraries(empty1 LINK_PUBLIC empty2)
+target_link_libraries(empty2 LINK_PUBLIC empty3 empty4)
+target_link_libraries(empty3 LINK_PUBLIC empty2 empty4)
+
+add_library(empty5 empty.cpp)
+target_include_directories(empty5 PRIVATE /empty5/private1 /empty5/private2)
+
add_custom_target(check-part2 ALL
COMMAND ${CMAKE_COMMAND}
-Dtest_incomplete_1=$<
@@ -89,6 +110,14 @@ add_custom_target(check-part2 ALL
-Dtest_install_interface=$<INSTALL_INTERFACE:install>
-Dtest_target_name_1=$<TARGET_NAME:tgt,ok>
-Dtest_target_name_2=$<TARGET_NAME:tgt:ok>
+ -Dtest_target_includes1=$<TARGET_PROPERTY:empty1,INTERFACE_INCLUDE_DIRECTORIES>
+ -Dtest_target_includes2=$<TARGET_PROPERTY:empty2,INTERFACE_INCLUDE_DIRECTORIES>
+ -Dtest_target_includes3=$<TARGET_PROPERTY:empty3,INTERFACE_INCLUDE_DIRECTORIES>
+ -Dtest_target_includes4=$<TARGET_PROPERTY:empty1,INCLUDE_DIRECTORIES>
+ -Dtest_target_includes5=$<TARGET_PROPERTY:empty2,INCLUDE_DIRECTORIES>
+ -Dtest_target_includes6=$<TARGET_PROPERTY:empty3,INCLUDE_DIRECTORIES>
+ -Dtest_target_includes7=$<TARGET_PROPERTY:empty1,INTERFACE_INCLUDE_DIRECTORIES>
+ -Dtest_target_includes8=$<TARGET_PROPERTY:empty5,INCLUDE_DIRECTORIES>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part2.cmake
COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 2)"
VERBATIM
diff --git a/Tests/GeneratorExpression/check-part2.cmake b/Tests/GeneratorExpression/check-part2.cmake
index 8855a97..44ded62 100644
--- a/Tests/GeneratorExpression/check-part2.cmake
+++ b/Tests/GeneratorExpression/check-part2.cmake
@@ -26,3 +26,11 @@ check(test_build_interface "build")
check(test_install_interface "")
check(test_target_name_1 "tgt,ok")
check(test_target_name_2 "tgt:ok")
+check(test_target_includes1 "/empty1/public;/empty2/public;/empty3/public;/empty4/public;/empty4/public")
+check(test_target_includes2 "/empty2/public;/empty3/public;/empty4/public;/empty4/public")
+check(test_target_includes3 "/empty3/public;/empty2/public;/empty4/public;/empty4/public")
+check(test_target_includes4 "/empty1/public;/empty1/private;/empty2/public;/empty3/public;/empty4/public")
+check(test_target_includes5 "/empty2/public;/empty3/public;/empty2/public;/empty4/public")
+check(test_target_includes6 "/empty3/public;/empty3/private;/empty2/public;/empty3/public;/empty4/public")
+check(test_target_includes7 "/empty1/public;/empty2/public;/empty3/public;/empty4/public;/empty4/public")
+check(test_target_includes8 "/empty5/private1;/empty5/private2")
diff --git a/Tests/GeneratorExpression/empty.cpp b/Tests/GeneratorExpression/empty.cpp
new file mode 100644
index 0000000..c539901
--- /dev/null
+++ b/Tests/GeneratorExpression/empty.cpp
@@ -0,0 +1,2 @@
+
+// empty
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list