summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-11-25 15:18:16 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-11-25 15:18:16 (GMT)
commit0f192080761529518128ee697d477ab5ec2e7ea8 (patch)
treec76d41b78e0533aff28830ef506e768ed6aa4acc /Modules
parentc5ac0fce5cf1020f661418eb1dc1f35c8f3207ed (diff)
parent557aef0b94c86d13e802e6e8e34a491304d7be2f (diff)
downloadCMake-0f192080761529518128ee697d477ab5ec2e7ea8.zip
CMake-0f192080761529518128ee697d477ab5ec2e7ea8.tar.gz
CMake-0f192080761529518128ee697d477ab5ec2e7ea8.tar.bz2
Merge topic 'custom-command-byproducts'
557aef0b ExternalProject: Add options to specify BYPRODUCTS (#14963) e15a7075 Add an option for explicit BYPRODUCTS of custom commands (#14963)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/ExternalProject.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 32f6d2c..e5616b1 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -132,6 +132,9 @@ Create custom targets to build projects in external trees
Use source dir for build dir
``BUILD_ALWAYS 1``
No stamp file, build step always runs
+ ``BUILD_BYPRODUCTS <file>...``
+ Files that will be generated by the build command but may or may
+ not have their modification time updated by subsequent builds.
Install step options are:
@@ -234,6 +237,9 @@ Create custom targets to build projects in external trees
Steps that depend on this step
``DEPENDS <file>...``
Files on which this step depends
+ ``BYPRODUCTS <file>...``
+ Files that will be generated by this step but may or may not
+ have their modification time updated by subsequent builds.
``ALWAYS 1``
No stamp file, step always runs
``EXCLUDE_FROM_MAIN 1``
@@ -1409,6 +1415,9 @@ function(ExternalProject_Add_Step name step)
# Dependencies on files.
get_property(depends TARGET ${name} PROPERTY _EP_${step}_DEPENDS)
+ # Byproducts of the step.
+ get_property(byproducts TARGET ${name} PROPERTY _EP_${step}_BYPRODUCTS)
+
# Dependencies on steps.
get_property(dependees TARGET ${name} PROPERTY _EP_${step}_DEPENDEES)
foreach(dependee IN LISTS dependees)
@@ -1466,6 +1475,7 @@ function(ExternalProject_Add_Step name step)
add_custom_command(
OUTPUT ${stamp_file}
+ BYPRODUCTS ${byproducts}
COMMENT ${comment}
COMMAND ${command}
COMMAND ${touch}
@@ -2139,8 +2149,11 @@ function(_ep_add_build_command name)
set(always 0)
endif()
+ get_property(build_byproducts TARGET ${name} PROPERTY _EP_BUILD_BYPRODUCTS)
+
ExternalProject_Add_Step(${name} build
COMMAND ${cmd}
+ BYPRODUCTS ${build_byproducts}
WORKING_DIRECTORY ${binary_dir}
DEPENDEES configure
ALWAYS ${always}