[Cmake-commits] CMake branch, next, updated. v3.1.1-2375-g3c5ce70
Brad King
brad.king at kitware.com
Tue Jan 27 11:08:57 EST 2015
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 3c5ce70fa8c1b4f7e27045a37a4bf9478e466751 (commit)
via 050dc316b6668708811311225ad923dc24e77950 (commit)
from da9cd65f4013ae4ebf7f215594cb5424d79a22d1 (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=3c5ce70fa8c1b4f7e27045a37a4bf9478e466751
commit 3c5ce70fa8c1b4f7e27045a37a4bf9478e466751
Merge: da9cd65 050dc31
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 27 11:08:56 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jan 27 11:08:56 2015 -0500
Merge topic 'fix-OBJECT_DEPENDS-after-path-normalization' into next
050dc316 Normalize OBJECT_DEPENDS paths to match custom commands (#15366)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=050dc316b6668708811311225ad923dc24e77950
commit 050dc316b6668708811311225ad923dc24e77950
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 27 10:57:17 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 27 11:07:30 2015 -0500
Normalize OBJECT_DEPENDS paths to match custom commands (#15366)
Custom command path normalization added in commit v3.1.0-rc1~471^2
(add_custom_command: Normalize OUTPUT and DEPENDS paths, 2014-05-28)
broke use of OBJECT_DEPENDS to bring in custom commands because the
latter paths were not normalized too. Normalize them and add a test
case.
Reported-by: Daniel v. Gerpen
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 14b5a92..0c60237 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -676,6 +676,14 @@ void cmTargetTraceDependencies::Trace()
{
std::vector<std::string> objDeps;
cmSystemTools::ExpandListArgument(additionalDeps, objDeps);
+ for(std::vector<std::string>::iterator odi = objDeps.begin();
+ odi != objDeps.end(); ++odi)
+ {
+ if (cmSystemTools::FileIsFullPath(*odi))
+ {
+ *odi = cmSystemTools::CollapseFullPath(*odi);
+ }
+ }
this->FollowNames(objDeps);
}
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index b97cd16..7ef3540 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -153,6 +153,19 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.c
${PROJECT_BINARY_DIR}/foo.c
)
+# Test using OBJECT_DEPENDS to bring in a custom command.
+# Use a path that can be simplified to make sure paths
+# are consistently normalized.
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/subdir/../subdir/subdir.h
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_CURRENT_SOURCE_DIR}/subdir.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/subdir/subdir.h
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/subdir.h.in
+ )
+set_property(SOURCE ${PROJECT_BINARY_DIR}/foo.c PROPERTY
+ OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/subdir/../subdir/subdir.h)
+
# Add custom command to generate not_included.h, which is a header
# file that is not included by any source in this project. This will
# test whether all custom command outputs explicitly listed as sources
diff --git a/Tests/CustomCommand/foo.in b/Tests/CustomCommand/foo.in
index 0c5021c..5ca6315 100644
--- a/Tests/CustomCommand/foo.in
+++ b/Tests/CustomCommand/foo.in
@@ -7,6 +7,11 @@
int generated();
int wrapped();
+#include "subdir/subdir.h"
+#ifndef SUBDIR_DEF
+# error SUBDIR_DEF not defined
+#endif
+
int main ()
{
if (generated()*wrapped()*doc() == 3*5*7)
diff --git a/Tests/CustomCommand/subdir.h.in b/Tests/CustomCommand/subdir.h.in
new file mode 100644
index 0000000..1e50750
--- /dev/null
+++ b/Tests/CustomCommand/subdir.h.in
@@ -0,0 +1 @@
+#define SUBDIR_DEF
-----------------------------------------------------------------------
Summary of changes:
Source/cmGeneratorTarget.cxx | 8 ++++++++
Tests/CustomCommand/CMakeLists.txt | 13 +++++++++++++
Tests/CustomCommand/foo.in | 5 +++++
Tests/CustomCommand/subdir.h.in | 1 +
4 files changed, 27 insertions(+)
create mode 100644 Tests/CustomCommand/subdir.h.in
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list