# Copyright (c) 2026 Dominic Masters # # This software is released under the MIT License. # https://opensource.org/licenses/MIT # Handler that copies an asset into the built assets directory as is. Every # handler has the signature (SOURCE RELATIVE OUT_VAR) and must set OUT_VAR, in # the caller's scope, to the file it produces. function(dusk_asset_copy ASSET_SOURCE ASSET_RELATIVE OUT_VAR) set(ASSET_OUTPUT "${DUSK_BUILT_ASSETS_DIR}/${ASSET_RELATIVE}") add_custom_command( OUTPUT "${ASSET_OUTPUT}" COMMAND ${CMAKE_COMMAND} -E copy_if_different "${ASSET_SOURCE}" "${ASSET_OUTPUT}" DEPENDS "${ASSET_SOURCE}" COMMENT "Copying asset ${ASSET_RELATIVE}" VERBATIM ) set(${OUT_VAR} "${ASSET_OUTPUT}" PARENT_SCOPE) endfunction()