[Cmake-commits] CMake branch, next, updated. v2.8.8-2813-g0b3eef4

Stephen Kelly steveire at gmail.com
Sat May 5 16:49:58 EDT 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  0b3eef43429aea54b6c35d73e45a40d598fa7c0f (commit)
       via  3905129ad9bcf0147457ca26c02ba2a66125a3cf (commit)
       via  c196e9ea359c882e55dd679a805e443fb120d195 (commit)
      from  6795c4ed6dcba18a3e1a4215bbea1a70e774991a (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=0b3eef43429aea54b6c35d73e45a40d598fa7c0f
commit 0b3eef43429aea54b6c35d73e45a40d598fa7c0f
Merge: 6795c4e 3905129
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 5 16:49:55 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat May 5 16:49:55 2012 -0400

    Merge topic 'relative-INCLUDE_DIRECTORIES' into next
    
    3905129 Make the INCLUDE_DIRECTORIES property relative to the source dir by default.
    c196e9e CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3905129ad9bcf0147457ca26c02ba2a66125a3cf
commit 3905129ad9bcf0147457ca26c02ba2a66125a3cf
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 5 22:44:17 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat May 5 22:44:17 2012 +0200

    Make the INCLUDE_DIRECTORIES property relative to the source dir by default.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 4789197..2c64579 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4709,9 +4709,13 @@ std::vector<std::string> cmTarget::GetIncludeDirectories()
   for(std::vector<std::string>::const_iterator
       li = includes.begin(); li != includes.end(); ++li)
     {
-    if(uniqueIncludes.insert(*li).second)
+    // Treat relative paths as relative to the source dir.
+    std::string dir = (cmSystemTools::CollapseFullPath
+         (li->c_str(), this->Makefile->GetCurrentDirectory()));
+
+    if(uniqueIncludes.insert(dir).second)
       {
-      orderedAndUniqueIncludes.push_back(*li);
+      orderedAndUniqueIncludes.push_back(dir);
       }
     }
 
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
index 2cf36f5..503f09f 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -23,4 +23,7 @@ add_executable(TargetIncludeDirectories main.cpp)
 set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/bat")
 set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/foo")
 
+# Test that relative directories are relative to the source dir.
+set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "source_include_dir")
+
 include_directories("${CMAKE_CURRENT_BINARY_DIR}/baz")
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
index 8aa3532..c854052 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
@@ -4,6 +4,8 @@
 #include "foo.h"
 #include "baz.h"
 
+#include "source_header.h"
+
 int main(int, char**)
 {
   return 0;
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/source_include_dir/source_header.h b/Tests/IncludeDirectories/TargetIncludeDirectories/source_include_dir/source_header.h
new file mode 100644
index 0000000..1296bcf
--- /dev/null
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/source_include_dir/source_header.h
@@ -0,0 +1,9 @@
+
+#ifndef SOURCE_HEADER_H
+#define SOURCE_HEADER_H
+
+enum {
+  non_empty_header = 10
+};
+
+#endif

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeVersion.cmake                          |    2 +-
 Source/cmTarget.cxx                                |    8 ++++++--
 .../TargetIncludeDirectories/CMakeLists.txt        |    3 +++
 .../TargetIncludeDirectories/main.cpp              |    2 ++
 .../source_include_dir/source_header.h             |    9 +++++++++
 5 files changed, 21 insertions(+), 3 deletions(-)
 create mode 100644 Tests/IncludeDirectories/TargetIncludeDirectories/source_include_dir/source_header.h


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list