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.
This commit is contained in:
Daniele E. Domenichelli 2014-11-05 00:31:32 +01:00
parent 917da5d027
commit c0b749cf62
1 changed files with 9 additions and 0 deletions

View File

@ -1423,6 +1423,15 @@ function(ExternalProject_Add_Step name step)
_ep_write_log_script(${name} ${step} command) _ep_write_log_script(${name} ${step} command)
endif() 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( add_custom_command(
OUTPUT ${stamp_file} OUTPUT ${stamp_file}
COMMENT ${comment} COMMENT ${comment}