[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5899-ga392449

Daniele E. Domenichelli daniele.domenichelli at gmail.com
Wed Nov 27 18:04:28 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  a3924493c1cb32063b254efaf62ac592e92df743 (commit)
       via  8348b99b863f602ac40ac56e84699fb5a3f66012 (commit)
      from  b8bbab49a67056db603ae48403de45b3fc758d58 (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=a3924493c1cb32063b254efaf62ac592e92df743
commit a3924493c1cb32063b254efaf62ac592e92df743
Merge: b8bbab4 8348b99
Author:     Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
AuthorDate: Wed Nov 27 18:04:23 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Nov 27 18:04:23 2013 -0500

    Merge topic 'ExternalProject-independent-step-targets' into next
    
    8348b99 ExternalProject: Add independent step targets


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8348b99b863f602ac40ac56e84699fb5a3f66012
commit 8348b99b863f602ac40ac56e84699fb5a3f66012
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Tue Nov 19 10:21:26 2013 +0100
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Thu Nov 28 00:03:53 2013 +0100

    ExternalProject: Add independent step targets
    
    When adding step targets using ExternalProject_Add_StepTargets, the
    STEP_TARGETS argument or the EP_STEP_TARGETS property, ExternalProject
    sets all the dependencies for the main project to that target.  Due to
    this, the update target cannot be used without downloading and building
    all the dependencies.
    
    In order to be able to add step targets that do not depend on other
    external projects, this patch adds:
    
    * An optional "NO_DEPENDS" argument to the
      ExternalProject_Add_StepTargets function. If this argument is set,
      then no dependencies are set for the target (file dependencies will
      still be set).
    
    * A new argument INDEPENDENT_STEP_TARGETS to the ExternalProject_Add
      function and a new directory property EP_INDEPENDENT_STEP_TARGETS that
      behave like STEP_TARGETS and EP_STEP_TARGETS, but cause the
      ExternalProject_Add_StepTargets to be called with the NO_DEPENDS
      argument.

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 63f1180..8c21ef0 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -69,6 +69,10 @@
 #    [LOG_INSTALL 1]             # Wrap install in script to log output
 #   #--Custom targets-------------
 #    [STEP_TARGETS st1 st2 ...]  # Generate custom targets for these steps
+#    [INDEPENDENT_STEP_TARGETS st1 st2 ...]
+#                                # Generate custom targets for these steps that
+#                                # do not depend on other external project even
+#                                # if a dependency is set
 #    )
 #
 # The ``*_DIR`` options specify directories for the project, with default
@@ -148,18 +152,30 @@
 # The ``ExternalProject_Add_StepTargets`` function generates custom
 # targets for the steps listed::
 #
-#  ExternalProject_Add_StepTargets(<name> [step1 [step2 [...]]])
+#  ExternalProject_Add_StepTargets(<name> [NO_DEPENDS] [step1 [step2 [...]]])
 #
-# If ``STEP_TARGETS`` is set then ``ExternalProject_Add_StepTargets`` is
-# automatically called at the end of matching calls to
-# ``ExternalProject_Add_Step``.  Pass ``STEP_TARGETS`` explicitly to
+# If ``NO_DEPENDS`` is set, the target will not depend on the
+# dependencies of the complete project. This is usually safe to use for
+# the download, update, and patch steps that do not require that all the
+# dependencies are updated and built.  Using ``NO_DEPENDS`` for other
+# of the default steps might break parallel builds, so you should avoid,
+# it.  For custom steps, you should consider whether or not the custom
+# commands requires that the dependencies are configured, built and
+# installed.
+#
+# If ``STEP_TARGETS`` or ``INDEPENDENT_STEP_TARGETS`` is set then
+# ``ExternalProject_Add_StepTargets`` is automatically called at the end
+# of matching calls to ``ExternalProject_Add_Step``.  Pass
+# ``STEP_TARGETS`` or ``INDEPENDENT_STEP_TARGETS`` explicitly to
 # individual ``ExternalProject_Add`` calls, or implicitly to all
-# ``ExternalProject_Add`` calls by setting the directory property
-# ``EP_STEP_TARGETS``.
+# ``ExternalProject_Add`` calls by setting the directory properties
+# ``EP_STEP_TARGETS`` and ``EP_INDEPENDENT_STEP_TARGETS``.  The
+# ``INDEPENDENT`` version of the argument and of the property will call
+# ``ExternalProject_Add_StepTargets`` with the ``NO_DEPENDS`` argument.
 #
-# If ``STEP_TARGETS`` is not set, clients may still manually call
-# ``ExternalProject_Add_StepTargets`` after calling
-# ``ExternalProject_Add`` or ``ExternalProject_Add_Step``.
+# If ``STEP_TARGETS`` and ``INDEPENDENT_STEP_TARGETS`` are not set,
+# clients may still manually call ``ExternalProject_Add_StepTargets``
+# after calling ``ExternalProject_Add`` or ``ExternalProject_Add_Step``.
 #
 # This functionality is provided to make it easy to drive the steps
 # independently of each other by specifying targets on build command
@@ -284,10 +300,19 @@ define_property(DIRECTORY PROPERTY "EP_STEP_TARGETS" INHERITED
   BRIEF_DOCS
   "List of ExternalProject steps that automatically get corresponding targets"
   FULL_DOCS
+  "These targets will be dependent on the main target dependencies"
   "See documentation of the ExternalProject_Add_StepTargets() function in the "
   "ExternalProject module."
   )
 
+define_property(DIRECTORY PROPERTY "EP_INDEPENDENT_STEP_TARGETS" INHERITED
+  BRIEF_DOCS
+  "List of ExternalProject steps that automatically get corresponding targets"
+  FULL_DOCS
+  "These targets will not be dependent on the main target dependencies"
+  "See documentation of the ExternalProject_Add_StepTargets() function in the "
+  "ExternalProject module."
+  )
 
 function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag src_name work_dir gitclone_infofile gitclone_stampfile)
   file(WRITE ${script_filename}
@@ -1050,17 +1075,25 @@ endfunction()
 
 function(ExternalProject_Add_StepTargets name)
   set(steps ${ARGN})
-
+  if("${ARGV1}" STREQUAL "NO_DEPENDS")
+    set(no_deps 1)
+    list(REMOVE_AT steps 0)
+  endif()
   foreach(step ${steps})
+    if(no_deps  AND  "${step}" MATCHES "^(configure|build|install|test)$")
+        message(AUTHOR_WARNING "Using NO_DEPENDS for \"${step}\" step  might break parallel builds")
+    endif()
     _ep_get_step_stampfile(${name} ${step} stamp_file)
     add_custom_target(${name}-${step}
       DEPENDS ${stamp_file})
 
     # Depend on other external projects (target-level).
-    get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS)
-    foreach(arg IN LISTS deps)
-      add_dependencies(${name}-${step} ${arg})
-    endforeach()
+    if(NOT no_deps)
+      get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS)
+      foreach(arg IN LISTS deps)
+        add_dependencies(${name}-${step} ${arg})
+      endforeach()
+    endif()
   endforeach()
 endfunction()
 
@@ -1160,6 +1193,17 @@ function(ExternalProject_Add_Step name step)
       break()
     endif()
   endforeach()
+
+  get_property(independent_step_targets TARGET ${name} PROPERTY _EP_INDEPENDENT_STEP_TARGETS)
+  if(NOT independent_step_targets)
+    get_property(independent_step_targets DIRECTORY PROPERTY EP_INDEPENDENT_STEP_TARGETS)
+  endif()
+  foreach(st ${independent_step_targets})
+    if("${st}" STREQUAL "${step}")
+      ExternalProject_Add_StepTargets(${name} NO_DEPENDS ${step})
+      break()
+    endif()
+  endforeach()
 endfunction()
 
 

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

Summary of changes:
 Modules/ExternalProject.cmake |   72 +++++++++++++++++++++++++++++++++--------
 1 files changed, 58 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list