[Cmake-commits] CMake branch, next, updated. v3.0.0-rc3-1728-gf83a50e

Daniele E. Domenichelli daniele.domenichelli at gmail.com
Tue Apr 1 12:18:27 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  f83a50e31dd56adf22d749edc5580df060afdf90 (commit)
       via  1ddcc582c1a408e054efdcc32c00a8c07299d115 (commit)
       via  0a1c0129617af6cbcc44a7f66fdb126603861e81 (commit)
      from  b69bd9e8a6a0508b3fc108bc0335cd345099d7e4 (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=f83a50e31dd56adf22d749edc5580df060afdf90
commit f83a50e31dd56adf22d749edc5580df060afdf90
Merge: b69bd9e 1ddcc58
Author:     Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
AuthorDate: Tue Apr 1 12:18:26 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 1 12:18:26 2014 -0400

    Merge topic 'ExternalProject_exclude-from-all' into next
    
    1ddcc582 ExternalProject: Add EXCLUDE_FROM_ALL option to ExternalProject_Add
    0a1c0129 ExternalProject: Add EXCLUDE_FROM_MAIN option to ExternalProject_Add_Step


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ddcc582c1a408e054efdcc32c00a8c07299d115
commit 1ddcc582c1a408e054efdcc32c00a8c07299d115
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Fri Dec 6 17:09:27 2013 +0100
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Tue Apr 1 18:17:31 2014 +0200

    ExternalProject: Add EXCLUDE_FROM_ALL option to ExternalProject_Add
    
    When adding a new external project, the "all" target will depend on
    this.
    This option allows one to add an external project will not be executed
    when the "all" target is executed.
    The reason for this is that an external project could be useful, for
    example, only for running tests, and therefore not necessary during
    the build.

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 3c86331..0f651e9 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -16,6 +16,7 @@
 #    [LIST_SEPARATOR sep]        # Sep to be replaced by ; in cmd lines
 #    [TMP_DIR dir]               # Directory to store temporary files
 #    [STAMP_DIR dir]             # Directory to store step timestamps
+#    [EXCLUDE_FROM_ALL 1]        # The "all" target does not depend on this
 #   #--Download step--------------
 #    [DOWNLOAD_NAME fname]       # File name to store (if not end of URL)
 #    [DOWNLOAD_DIR dir]          # Directory to store downloaded files
@@ -1913,6 +1914,9 @@ function(ExternalProject_Add name)
   set(cmf_dir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles)
   set(complete_stamp_file "${cmf_dir}${cfgdir}/${name}-complete")
 
+  # The "ALL" option to add_custom_target just tells it to not set the
+  # EXCLUDE_FROM_ALL target property. Later, if the EXCLUDE_FROM_ALL
+  # argument was passed, we explicitly set it for the target.
   add_custom_target(${name} ALL DEPENDS ${complete_stamp_file})
   set_property(TARGET ${name} PROPERTY _EP_IS_EXTERNAL_PROJECT 1)
   _ep_parse_arguments(ExternalProject_Add ${name} _EP_ "${ARGN}")
@@ -1920,6 +1924,12 @@ function(ExternalProject_Add name)
   _ep_get_step_stampfile(${name} "done" done_stamp_file)
   _ep_get_step_stampfile(${name} "install" install_stamp_file)
 
+  # Set the EXCLUDE_FROM_ALL target property if required.
+  get_property(exclude_from_all TARGET ${name} PROPERTY _EP_EXCLUDE_FROM_ALL)
+  if(exclude_from_all)
+    set_property(TARGET ${name} PROPERTY EXCLUDE_FROM_ALL TRUE)
+  endif()
+
   # The 'complete' step depends on all other steps and creates a
   # 'done' mark.  A dependent external project's 'configure' step
   # depends on the 'done' mark so that it rebuilds when this project

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a1c0129617af6cbcc44a7f66fdb126603861e81
commit 0a1c0129617af6cbcc44a7f66fdb126603861e81
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Wed Dec 4 10:05:50 2013 +0100
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Tue Apr 1 18:17:31 2014 +0200

    ExternalProject: Add EXCLUDE_FROM_MAIN option to ExternalProject_Add_Step
    
    When adding a new step using ExternalProject_Add_Step, the main target
    will depend on this step.
    This option allows one to add a step that will not be executed when the
    main target for the external project is executed.

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index e490e69..3c86331 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -119,6 +119,7 @@
 #    [DEPENDERS steps...]    # Steps that depend on this step
 #    [DEPENDS files...]      # Files on which this step depends
 #    [ALWAYS 1]              # No stamp file, step always runs
+#    [EXCLUDE_FROM_MAIN 1]   # Main target does not depend on this step
 #    [WORKING_DIRECTORY dir] # Working directory for command
 #    [LOG 1]                 # Wrap step in script to log output
 #    )
@@ -1192,14 +1193,17 @@ function(ExternalProject_Add_Step name step)
   set(complete_stamp_file "${cmf_dir}${cfgdir}/${name}-complete")
   _ep_get_step_stampfile(${name} ${step} stamp_file)
 
-  add_custom_command(APPEND
-    OUTPUT ${complete_stamp_file}
-    DEPENDS ${stamp_file}
-    )
-
   _ep_parse_arguments(ExternalProject_Add_Step
                       ${name} _EP_${step}_ "${ARGN}")
 
+  get_property(exclude_from_main TARGET ${name} PROPERTY _EP_${step}_EXCLUDE_FROM_MAIN)
+  if(NOT exclude_from_main)
+    add_custom_command(APPEND
+      OUTPUT ${complete_stamp_file}
+      DEPENDS ${stamp_file}
+      )
+  endif()
+
   # Steps depending on this step.
   get_property(dependers TARGET ${name} PROPERTY _EP_${step}_DEPENDERS)
   foreach(depender IN LISTS dependers)

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

Summary of changes:
 Modules/ExternalProject.cmake |   24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list