I have shell scripts in some sub projects. These projects do not compile anything. What I want is to copy the scripts and / or pre-built binaries to the same location as it would if it compiled a local app.
#configure_file(test.sh test.sh COPYONLY)
add_custom_target(run ALL DEPENDS test.sh)
#add_custom_target(foo
# COMMAND cp test.sh
# ${CMAKE_CURRENT_BINARY_DIR}/test.sh)
add_custom_command(
OUTPUT test.sh
COMMAND cp test.sh ${CMAKE_CURRENT_BINARY_DIR}/test.sh
DEPENDS test.sh)
# COMMAND ${CMAKE_COMMAND} -E copy
# ${CMAKE_SOURCE_DIR}/test.sh
# ${CMAKE_CURRENT_BINARY_DIR}/test.sh)
This shows everything I tried.
configure_file works only if I do a clean build and never again. I need it to work every time I do a diff build.