2015-12-21 07:23:01 +00:00
|
|
|
function(copy_after_build sourceGlob relativeTargetDirectory)
|
|
|
|
# Set `sourcePaths`
|
|
|
|
file(GLOB sourcePaths "${sourceGlob}")
|
|
|
|
|
|
|
|
foreach(sourcePath ${sourcePaths})
|
|
|
|
# Set `fileName`
|
|
|
|
get_filename_component(fileName "${sourcePath}" NAME)
|
|
|
|
|
|
|
|
# Set `targetPath`
|
2016-01-08 15:59:18 +00:00
|
|
|
set(targetPath "$<TARGET_FILE_DIR:rhubarb>/${relativeTargetDirectory}/${fileName}")
|
2015-12-21 07:23:01 +00:00
|
|
|
|
|
|
|
add_custom_command(TARGET rhubarb POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy "${sourcePath}" "${targetPath}"
|
|
|
|
COMMENT "Creating '${relativeTargetDirectory}/${fileName}'"
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
endfunction()
|