summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorDaniele E. Domenichelli <daniele.domenichelli@iit.it>2013-12-04 09:05:50 (GMT)
committerDaniele E. Domenichelli <daniele.domenichelli@iit.it>2014-04-01 16:17:31 (GMT)
commit0a1c0129617af6cbcc44a7f66fdb126603861e81 (patch)
treed12c4a15a52dedadeb62174a3624a54e3a3679cf /Modules/ExternalProject.cmake
parent358be9b3207ad92a7ce4a5744db6a7265d8a0844 (diff)
downloadCMake-0a1c0129617af6cbcc44a7f66fdb126603861e81.zip
CMake-0a1c0129617af6cbcc44a7f66fdb126603861e81.tar.gz
CMake-0a1c0129617af6cbcc44a7f66fdb126603861e81.tar.bz2
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.
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake14
1 files changed, 9 insertions, 5 deletions
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)