Add resource copy command.
This commit is contained in:
parent
07f3a237b5
commit
fa8351c866
|
|
@ -17,6 +17,7 @@ else ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include(add_shader.cmake)
|
include(add_shader.cmake)
|
||||||
|
include(add_resource_dir.cmake)
|
||||||
|
|
||||||
add_subdirectory("aster")
|
add_subdirectory("aster")
|
||||||
add_subdirectory("samples")
|
add_subdirectory("samples")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
function(add_resource_dir TARGET DIR)
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${TARGET} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/${DIR}/
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/${DIR}/)
|
||||||
|
endfunction(add_resource_dir)
|
||||||
|
|
@ -11,6 +11,4 @@ add_shader(box shader/box.frag.glsl)
|
||||||
target_link_libraries(box PRIVATE aster_core)
|
target_link_libraries(box PRIVATE aster_core)
|
||||||
target_link_libraries(box PRIVATE util_helper)
|
target_link_libraries(box PRIVATE util_helper)
|
||||||
|
|
||||||
add_custom_target(copy-resource-files ALL
|
add_resource_dir(box image)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/image/ ${CMAKE_CURRENT_BINARY_DIR}/
|
|
||||||
DEPENDS box)
|
|
||||||
Loading…
Reference in New Issue