[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3539-ge23f133

Stephen Kelly steveire at gmail.com
Wed Jul 31 10:09:21 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  e23f1338b6bbd75cf2a93e9fa7fef7a86656ec7b (commit)
       via  c0b868220084ad6d2ca88a4fdd9564f887374fc2 (commit)
      from  0192404df3e4bb1ab4b2032043e91ca39a833007 (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=e23f1338b6bbd75cf2a93e9fa7fef7a86656ec7b
commit e23f1338b6bbd75cf2a93e9fa7fef7a86656ec7b
Merge: 0192404 c0b8682
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Jul 31 10:08:56 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jul 31 10:08:56 2013 -0400

    Merge topic 'target-command-allow-no-items' into next
    
    c0b8682 Allow target commands to be invoked with no items (#14325).


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c0b868220084ad6d2ca88a4fdd9564f887374fc2
commit c0b868220084ad6d2ca88a4fdd9564f887374fc2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Jul 31 16:02:07 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jul 31 16:06:34 2013 +0200

    Allow target commands to be invoked with no items (#14325).
    
    Code such as
    
     target_include_directories(foo PRIVATE ${items})
    
    should not work or break based on whether items is defined or not.

diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index 287ce46..37aa604 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -19,7 +19,7 @@ bool cmTargetPropCommandBase
 ::HandleArguments(std::vector<std::string> const& args, const char *prop,
                  ArgumentFlags flags)
 {
-  if(args.size() < 3)
+  if(args.size() < 2)
     {
     this->SetError("called with incorrect number of arguments");
     return false;
@@ -53,7 +53,7 @@ bool cmTargetPropCommandBase
 
   if ((flags & PROCESS_SYSTEM) && args[argIndex] == "SYSTEM")
     {
-    if (args.size() < 4)
+    if (args.size() < 3)
       {
       this->SetError("called with incorrect number of arguments");
       return false;
@@ -65,7 +65,7 @@ bool cmTargetPropCommandBase
   bool prepend = false;
   if ((flags & PROCESS_BEFORE) && args[argIndex] == "BEFORE")
     {
-    if (args.size() < 4)
+    if (args.size() < 3)
       {
       this->SetError("called with incorrect number of arguments");
       return false;
diff --git a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
index 6d0e646..900dbd0 100644
--- a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
@@ -20,3 +20,8 @@ target_compile_definitions(consumer
   PRIVATE $<TARGET_PROPERTY:target_compile_definitions,INTERFACE_COMPILE_DEFINITIONS>
   -DDASH_D_DEFINE
 )
+
+# Test no items
+target_compile_definitions(consumer
+  PRIVATE
+)
diff --git a/Tests/CMakeCommands/target_compile_options/CMakeLists.txt b/Tests/CMakeCommands/target_compile_options/CMakeLists.txt
index 06a48fb..1d04639 100644
--- a/Tests/CMakeCommands/target_compile_options/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_compile_options/CMakeLists.txt
@@ -33,3 +33,8 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
       "DO_GNU_TESTS"
   )
 endif()
+
+# Test no items
+target_compile_options(consumer
+  PRIVATE
+)
diff --git a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
index c03f0f8..21b8e15 100644
--- a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
@@ -47,3 +47,17 @@ target_include_directories(consumer
     $<TARGET_PROPERTY:target_include_directories,INTERFACE_INCLUDE_DIRECTORIES>
   relative_dir
 )
+
+# Test no items
+target_include_directories(consumer
+  PRIVATE
+)
+target_include_directories(consumer
+  BEFORE PRIVATE
+)
+target_include_directories(consumer
+  SYSTEM BEFORE PRIVATE
+)
+target_include_directories(consumer
+  SYSTEM PRIVATE
+)

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

Summary of changes:
 Source/cmTargetPropCommandBase.cxx                 |    6 +++---
 .../target_compile_definitions/CMakeLists.txt      |    5 +++++
 .../target_compile_options/CMakeLists.txt          |    5 +++++
 .../target_include_directories/CMakeLists.txt      |   14 ++++++++++++++
 4 files changed, 27 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list