[Cmake-commits] CMake branch, next, updated. v3.0.0-rc2-1209-gdf8e6d2

Stephen Kelly steveire at gmail.com
Wed Mar 19 10:52:25 EDT 2014


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  df8e6d23e0e7a3ddc4a84835ece38a0d99ad2607 (commit)
       via  2600e923a66a86784f756c7d5b9a8b06c5848576 (commit)
      from  18a9ea52fc659088d57e9841f4dcace915dd45aa (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=df8e6d23e0e7a3ddc4a84835ece38a0d99ad2607
commit df8e6d23e0e7a3ddc4a84835ece38a0d99ad2607
Merge: 18a9ea5 2600e92
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Mar 19 10:52:24 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Mar 19 10:52:24 2014 -0400

    Merge topic 'add_custom_command-no-INTERFACE-lib' into next
    
    2600e923 Disallow INTERFACE libraries with add_custom_command(TARGET).


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2600e923a66a86784f756c7d5b9a8b06c5848576
commit 2600e923a66a86784f756c7d5b9a8b06c5848576
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Mar 19 15:50:01 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Mar 19 15:51:21 2014 +0100

    Disallow INTERFACE libraries with add_custom_command(TARGET).
    
    Don't attempt to trace their dependencies.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index aca195c..7890379 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -263,7 +263,8 @@ void cmLocalGenerator::TraceDependencies()
   for(cmGeneratorTargetsType::iterator t = targets.begin();
       t != targets.end(); ++t)
     {
-    if (t->second->Target->IsImported())
+    if (t->second->Target->IsImported()
+        || t->second->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
       {
       continue;
       }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index f248c57..10137ec 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -926,6 +926,14 @@ cmMakefile::AddCustomCommandToTarget(const char* target,
     this->IssueMessage(cmake::FATAL_ERROR, e.str());
     return;
     }
+  if(ti->second.GetType() == cmTarget::INTERFACE_LIBRARY)
+    {
+    cmOStringStream e;
+    e << "Target \"" << target << "\" is an INTERFACE library "
+      "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands.";
+    this->IssueMessage(cmake::FATAL_ERROR, e.str());
+    return;
+    }
   // Add the command to the appropriate build step for the target.
   std::vector<std::string> no_output;
   cmCustomCommand cc(this, no_output, depends,
diff --git a/Tests/RunCMake/interface_library/RunCMakeTest.cmake b/Tests/RunCMake/interface_library/RunCMakeTest.cmake
index 3c457c5..08e81c6 100644
--- a/Tests/RunCMake/interface_library/RunCMakeTest.cmake
+++ b/Tests/RunCMake/interface_library/RunCMakeTest.cmake
@@ -8,3 +8,4 @@ run_cmake(invalid_signature)
 run_cmake(global-interface)
 run_cmake(genex_link)
 run_cmake(add_dependencies)
+run_cmake(add_custom_command-TARGET)
diff --git a/Tests/RunCMake/interface_library/add_custom_command-TARGET-result.txt b/Tests/RunCMake/interface_library/add_custom_command-TARGET-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/interface_library/add_custom_command-TARGET-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/add_custom_command-TARGET-stderr.txt b/Tests/RunCMake/interface_library/add_custom_command-TARGET-stderr.txt
new file mode 100644
index 0000000..c095262
--- /dev/null
+++ b/Tests/RunCMake/interface_library/add_custom_command-TARGET-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at add_custom_command-TARGET.cmake:4 \(add_custom_command\):
+  Target "iface" is an INTERFACE library that may not have PRE_BUILD,
+  PRE_LINK, or POST_BUILD commands.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/interface_library/add_custom_command-TARGET.cmake b/Tests/RunCMake/interface_library/add_custom_command-TARGET.cmake
new file mode 100644
index 0000000..a5136ef
--- /dev/null
+++ b/Tests/RunCMake/interface_library/add_custom_command-TARGET.cmake
@@ -0,0 +1,6 @@
+
+add_library(iface INTERFACE)
+
+add_custom_command(TARGET iface
+  COMMAND "${CMAKE_COMMAND}" -E echo test
+)

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

Summary of changes:
 Source/cmLocalGenerator.cxx                                    |    3 ++-
 Source/cmMakefile.cxx                                          |    8 ++++++++
 Tests/RunCMake/interface_library/RunCMakeTest.cmake            |    1 +
 .../add_custom_command-TARGET-result.txt}                      |    0
 .../interface_library/add_custom_command-TARGET-stderr.txt     |    5 +++++
 .../RunCMake/interface_library/add_custom_command-TARGET.cmake |    6 ++++++
 6 files changed, 22 insertions(+), 1 deletion(-)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => interface_library/add_custom_command-TARGET-result.txt} (100%)
 create mode 100644 Tests/RunCMake/interface_library/add_custom_command-TARGET-stderr.txt
 create mode 100644 Tests/RunCMake/interface_library/add_custom_command-TARGET.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list