[Cmake-commits] CMake branch, next, updated. v2.8.12.1-6101-g5b76b26
Brad King
brad.king at kitware.com
Fri Dec 6 15:57:03 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 5b76b26287946fbbdc38f8b973d63746c7ad0f76 (commit)
via fc748185f49a4685f860a4f27f11b06ab94ff656 (commit)
via e324c587b00c518799ee6a5cbf25809fa1bb0475 (commit)
from 2ecbca00a52d5b97c8cb843b3752aec0e544612b (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=5b76b26287946fbbdc38f8b973d63746c7ad0f76
commit 5b76b26287946fbbdc38f8b973d63746c7ad0f76
Merge: 2ecbca0 fc74818
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 6 15:56:59 2013 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Dec 6 15:56:59 2013 -0500
Merge topic 'ExternalProject-independent-step-targets' into next
fc74818 ExternalProject: Fix tests with ninja
e324c58 ExternalProject: Add independent step targets
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc748185f49a4685f860a4f27f11b06ab94ff656
commit fc748185f49a4685f860a4f27f11b06ab94ff656
Author: Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Thu Dec 5 09:58:22 2013 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Dec 6 15:54:46 2013 -0500
ExternalProject: Fix tests with ninja
Update step for external projects depending on "SetupLocal*Repository"
is not supposed to be independent, otherwise with parallel builds the
update step might be executed before the repository is ready.
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index e22d84a..b4dca29 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -309,6 +309,7 @@ if(do_cvs_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalCVSRepository"
+ INDEPENDENT_STEP_TARGETS ""
)
set_property(TARGET ${proj} PROPERTY FOLDER "CVS")
@@ -324,6 +325,7 @@ if(do_cvs_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalCVSRepository"
+ INDEPENDENT_STEP_TARGETS ""
)
set_property(TARGET ${proj} PROPERTY FOLDER "CVS")
@@ -344,6 +346,7 @@ if(do_cvs_tests)
DEPENDS "TutorialStep1-LocalNoDirTGZ"
DEPENDS "TutorialStep1-CVS-20090626"
DEPENDS "TutorialStep1-CVS-testtag1"
+ INDEPENDENT_STEP_TARGETS ""
)
set_property(TARGET ${proj} PROPERTY FOLDER "CVS")
endif()
@@ -405,6 +408,7 @@ if(do_svn_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalSVNRepository"
+ INDEPENDENT_STEP_TARGETS ""
)
set_property(TARGET ${proj} PROPERTY FOLDER "SVN")
@@ -419,6 +423,7 @@ if(do_svn_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalSVNRepository"
+ INDEPENDENT_STEP_TARGETS ""
)
set_property(TARGET ${proj} PROPERTY FOLDER "SVN")
@@ -431,6 +436,7 @@ if(do_svn_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalSVNRepository"
+ INDEPENDENT_STEP_TARGETS ""
LOG_DOWNLOAD 1
)
set_property(TARGET ${proj} PROPERTY FOLDER "SVN")
@@ -485,6 +491,7 @@ if(do_git_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalGITRepository"
+ INDEPENDENT_STEP_TARGETS ""
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
@@ -499,6 +506,7 @@ if(do_git_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalGITRepository"
+ INDEPENDENT_STEP_TARGETS ""
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
@@ -511,6 +519,7 @@ if(do_git_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalGITRepository"
+ INDEPENDENT_STEP_TARGETS ""
LOG_UPDATE 1
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
@@ -551,6 +560,7 @@ if(do_hg_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalHGRepository"
+ INDEPENDENT_STEP_TARGETS ""
)
set_property(TARGET ${proj} PROPERTY FOLDER "HG")
@@ -565,6 +575,7 @@ if(do_hg_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalHGRepository"
+ INDEPENDENT_STEP_TARGETS ""
)
set_property(TARGET ${proj} PROPERTY FOLDER "HG")
@@ -580,6 +591,7 @@ if(do_hg_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalHGRepository"
+ INDEPENDENT_STEP_TARGETS ""
LOG_UPDATE 1
)
set_property(TARGET ${proj} PROPERTY FOLDER "HG")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e324c587b00c518799ee6a5cbf25809fa1bb0475
commit e324c587b00c518799ee6a5cbf25809fa1bb0475
Author: Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Tue Nov 19 10:21:26 2013 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Dec 6 15:54:46 2013 -0500
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..7b40b0e 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -69,6 +69,9 @@
# [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 +151,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 +299,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 +1074,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 +1192,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()
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 602ff0f..e22d84a 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -21,6 +21,7 @@ set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER
set(base "${CMAKE_BINARY_DIR}/CMakeExternals")
set(binary_base "${base}/Build")
set_property(DIRECTORY PROPERTY EP_BASE ${base})
+set_property(DIRECTORY PROPERTY EP_INDEPENDENT_STEP_TARGETS update)
set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
if(NOT DEFINED can_build_tutorial_step5)
@@ -100,7 +101,8 @@ ExternalProject_Add(${proj}
DOWNLOAD_COMMAND ""
INSTALL_COMMAND ""
PATCH_COMMAND ""
- STEP_TARGETS install update
+ INDEPENDENT_STEP_TARGETS update
+ STEP_TARGETS install
SVN_REPOSITORY ""
SVN_REVISION ""
SVN_USERNAME ""
diff --git a/Tests/ExternalProjectUpdate/CMakeLists.txt b/Tests/ExternalProjectUpdate/CMakeLists.txt
index c33e90b..2cffb69 100644
--- a/Tests/ExternalProjectUpdate/CMakeLists.txt
+++ b/Tests/ExternalProjectUpdate/CMakeLists.txt
@@ -18,6 +18,7 @@ set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER
set(base "${CMAKE_BINARY_DIR}/CMakeExternals")
set(binary_base "${base}/Build")
set_property(DIRECTORY PROPERTY EP_BASE ${base})
+set_property(DIRECTORY PROPERTY EP_INDEPENDENT_STEP_TARGETS update)
set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
set(do_git_tests 0)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 593921f..bd720a2 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -137,3 +137,4 @@ add_RunCMake_test(File_Generate)
add_RunCMake_test(ExportWithoutLanguage)
add_RunCMake_test(target_link_libraries)
add_RunCMake_test(CheckModules)
+add_RunCMake_test(ExternalProject)
diff --git a/Tests/RunCMake/ExternalProject/CMakeLists.txt b/Tests/RunCMake/ExternalProject/CMakeLists.txt
new file mode 100644
index 0000000..4b3de84
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ExternalProject/NO_DEPENDS-stderr.txt b/Tests/RunCMake/ExternalProject/NO_DEPENDS-stderr.txt
new file mode 100644
index 0000000..4cb051d
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/NO_DEPENDS-stderr.txt
@@ -0,0 +1,36 @@
+CMake Warning \(dev\) at .*/Modules/ExternalProject.cmake:[0-9]+. \(message\):
+ Using NO_DEPENDS for "configure" step might break parallel builds
+Call Stack \(most recent call first\):
+ .*/Modules/ExternalProject.cmake:[0-9]+ \(ExternalProject_Add_StepTargets\)
+ .*/Modules/ExternalProject.cmake:[0-9]+ \(ExternalProject_Add_Step\)
+ .*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_add_configure_command\)
+ NO_DEPENDS.cmake:[0-9]+ \(ExternalProject_Add\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at .*/Modules/ExternalProject.cmake:[0-9]+. \(message\):
+ Using NO_DEPENDS for "build" step might break parallel builds
+Call Stack \(most recent call first\):
+ .*/Modules/ExternalProject.cmake:[0-9]+ \(ExternalProject_Add_StepTargets\)
+ .*/Modules/ExternalProject.cmake:[0-9]+ \(ExternalProject_Add_Step\)
+ .*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_add_build_command\)
+ NO_DEPENDS.cmake:[0-9]+ \(ExternalProject_Add\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at .*/Modules/ExternalProject.cmake:[0-9]+. \(message\):
+ Using NO_DEPENDS for "install" step might break parallel builds
+Call Stack \(most recent call first\):
+ .*/Modules/ExternalProject.cmake:[0-9]+ \(ExternalProject_Add_StepTargets\)
+ .*/Modules/ExternalProject.cmake:[0-9]+ \(ExternalProject_Add_Step\)
+ .*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_add_install_command\)
+ NO_DEPENDS.cmake:[0-9]+ \(ExternalProject_Add\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at .*/Modules/ExternalProject.cmake:[0-9]+. \(message\):
+ Using NO_DEPENDS for "test" step might break parallel builds
+Call Stack \(most recent call first\):
+ NO_DEPENDS.cmake:[0-9]+ \(ExternalProject_Add_StepTargets\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/ExternalProject/NO_DEPENDS.cmake b/Tests/RunCMake/ExternalProject/NO_DEPENDS.cmake
new file mode 100644
index 0000000..57626d6
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/NO_DEPENDS.cmake
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 2.8.12)
+
+include(ExternalProject RESULT_VARIABLE GOO)
+
+set_property(DIRECTORY PROPERTY EP_INDEPENDENT_STEP_TARGETS download patch update configure build)
+
+ExternalProject_Add(FOO
+ URL https://example.org/foo.tar.gz)
+
+ExternalProject_Add(BAR
+ URL https://example.org/bar.tar.gz
+ TEST_COMMAND echo test
+ INDEPENDENT_STEP_TARGETS install)
+# This one should not give a warning
+ExternalProject_Add_Step(BAR bar
+ COMMAND echo bar)
+
+ExternalProject_Add_StepTargets(BAR NO_DEPENDS test bar)
diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
new file mode 100644
index 0000000..48965ad
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(NO_DEPENDS)
-----------------------------------------------------------------------
Summary of changes:
Modules/ExternalProject.cmake | 71 ++++++++++++++++----
Tests/ExternalProject/CMakeLists.txt | 16 ++++-
Tests/ExternalProjectUpdate/CMakeLists.txt | 1 +
Tests/RunCMake/CMakeLists.txt | 1 +
.../{set => ExternalProject}/CMakeLists.txt | 0
.../RunCMake/ExternalProject/NO_DEPENDS-stderr.txt | 36 ++++++++++
Tests/RunCMake/ExternalProject/NO_DEPENDS.cmake | 18 +++++
Tests/RunCMake/ExternalProject/RunCMakeTest.cmake | 3 +
8 files changed, 131 insertions(+), 15 deletions(-)
copy Tests/RunCMake/{set => ExternalProject}/CMakeLists.txt (100%)
create mode 100644 Tests/RunCMake/ExternalProject/NO_DEPENDS-stderr.txt
create mode 100644 Tests/RunCMake/ExternalProject/NO_DEPENDS.cmake
create mode 100644 Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list