summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-11-14 00:26:36 (GMT)
committerBrad King <brad.king@kitware.com>2014-11-17 14:36:42 (GMT)
commit557aef0b94c86d13e802e6e8e34a491304d7be2f (patch)
treea05394a276ea8c490cee08c0e1d38d5b207f1b6e /Modules/ExternalProject.cmake
parente15a7075b58aef6fe7b6eb56f810d0f33bc31feb (diff)
downloadCMake-557aef0b94c86d13e802e6e8e34a491304d7be2f.zip
CMake-557aef0b94c86d13e802e6e8e34a491304d7be2f.tar.gz
CMake-557aef0b94c86d13e802e6e8e34a491304d7be2f.tar.bz2
ExternalProject: Add options to specify BYPRODUCTS (#14963)
The external project's build process may generate byproducts on which other rules in the driving project's build later depend. Provide a way for the driving project to specify what byproducts it expects to be made available by the custom commands that drive the external project.
Diffstat (limited to 'Modules/ExternalProject.cmake')
-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}