Created
October 20, 2021 15:46
-
-
Save byBretema/16adcd42ebd420af392967cc5a51629c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(COPY_FROM_TO_DIR src_dir dst_dir) | |
file(GLOB src_files ${src_dir}/*) | |
foreach(src_file IN LISTS src_files) | |
get_filename_component(file_and_ext ${src_file} NAME) | |
set(dst_file ${dst_dir}/${file_and_ext}) | |
# MESSAGE(STATUS "[[[COPY_FROM_TO_DIR]]] :\n * ${src_file}\n * ${dst_file}") | |
# add_custom_command(COMMAND ${CMAKE_COMMAND} -E make_directory ${dst_dir} OUTPUT ${dst_dir}) | |
add_custom_command( | |
TARGET ${PROJECT_NAME} POST_BUILD | |
COMMAND ${CMAKE_COMMAND} -E copy ${src_file} ${dst_file} | |
) | |
endforeach() | |
endfunction() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment