summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorDaniele E. Domenichelli <daniele.domenichelli@iit.it>2014-11-04 23:31:32 (GMT)
committerDaniele E. Domenichelli <daniele.domenichelli@iit.it>2014-11-06 14:09:43 (GMT)
commitc0b749cf62a2e985c2b1f94ff919107dbd697b2c (patch)
tree485193815e5691b28af643e440dc63fcc3acf3d6 /Modules/ExternalProject.cmake
parent917da5d02766e875ec63eca09eb52b789114674c (diff)
downloadCMake-c0b749cf62a2e985c2b1f94ff919107dbd697b2c.zip
CMake-c0b749cf62a2e985c2b1f94ff919107dbd697b2c.tar.gz
CMake-c0b749cf62a2e985c2b1f94ff919107dbd697b2c.tar.bz2
ExternalProject: Always add a command to a step
Some generators (i.e. Xcode) will not generate a file level target if no command is set, and therefore the dependencies on this target will be broken. This patch sets an empty echo command that does nothing to avoid this issue.
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 8513437..bf6cd21 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1423,6 +1423,15 @@ function(ExternalProject_Add_Step name step)
_ep_write_log_script(${name} ${step} command)
endif()
+ if("${command}" STREQUAL "")
+ # Some generators (i.e. Xcode) will not generate a file level target
+ # if no command is set, and therefore the dependencies on this
+ # target will be broken.
+ # The empty command is replaced by an echo command here in order to
+ # avoid this issue.
+ set(command ${CMAKE_COMMAND} -E echo_append)
+ endif()
+
add_custom_command(
OUTPUT ${stamp_file}
COMMENT ${comment}