Last active
December 31, 2024 23:27
-
-
Save kwsp/e9f1439c14f9c7ea449c090c8d11e805 to your computer and use it in GitHub Desktop.
Copy resources from source dir to CMake multi-config build directory
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_to_target_dir target resource) | |
add_custom_command( | |
TARGET ${target} POST_BUILD | |
COMMAND ${CMAKE_COMMAND} -E copy_directory | |
"$<TARGET_PROPERTY:${target},SOURCE_DIR>/${resource}" | |
"$<TARGET_FILE_DIR:${target}>/${resource}" | |
) | |
endfunction() | |
copy_to_target_dir(${EXE_NAME} shaders) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment