diff --git a/cmake/modules/ExternalProject.cmake b/cmake/modules/ExternalProject.cmake index c09ccaf641e6ceafcbcf05daae6e9091562360e8..8e6ce3276f800ebaaabce167e466d31bc3eb4717 100644 --- a/cmake/modules/ExternalProject.cmake +++ b/cmake/modules/ExternalProject.cmake @@ -1161,7 +1161,7 @@ function(ExternalProject_Add_Step name step) if(command AND log) _ep_write_log_script(${name} ${step} command) endif() - +if(work_dir) add_custom_command( OUTPUT ${stamp_file} COMMENT ${comment} @@ -1171,7 +1171,16 @@ function(ExternalProject_Add_Step name step) WORKING_DIRECTORY ${work_dir} VERBATIM ) - +else() + add_custom_command( + OUTPUT ${stamp_file} + COMMENT ${comment} + COMMAND ${command} + COMMAND ${touch} + DEPENDS ${depends} + VERBATIM + ) +endif() # Add custom "step target"? get_property(step_targets TARGET ${name} PROPERTY _EP_STEP_TARGETS) if(NOT step_targets)