Doing some code reshuffling

This commit is contained in:
2021-11-01 14:34:42 -07:00
parent 5c7468283b
commit a86592f5bd
13 changed files with 77 additions and 17 deletions

View File

@ -9,4 +9,27 @@ function(tool_assets args)
DEPENDS ${ARGV}
COMMENT "Compressing Assets"
)
endfunction()
function(tool_copy target)
math(EXPR CARGSN "${ARGC} - 1")
set(LOOP_DEPENDENCIES)
foreach(index RANGE 1 ${CARGSN} 2)
math(EXPR indexnext "${index} + 1")
set(LOOP_TARGET "item_${target}_${index}")
LIST(GET ARGV ${index} from)
LIST(GET ARGV ${indexnext} to)
LIST(APPEND LOOP_DEPENDENCIES ${LOOP_TARGET})
add_custom_command(OUTPUT ${LOOP_TARGET}
COMMAND ${CMAKE_COMMAND} -E copy "${ROOT_DIR}/${ASSETS_DIR}/${from}" "${ASSETS_DIR}/${to}"
COMMENT "Copying ${from} => ${to}"
)
endforeach()
add_custom_target(${target}
DEPENDS ${MY_LIST}
COMMENT "Copying ${FILE_NAME}"
)
endfunction()