# Copyright (c) 2023 Dominic Masters
# 
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT


function(tool_map target file)
  add_custom_target(${target}
    COMMAND
      ${Python3_EXECUTABLE}
      ${DAWN_TOOLS_DIR}/maptool/maptool.py
      --input=${DAWN_ASSETS_SOURCE_DIR}/${file}
      --output=${DAWN_ASSETS_BUILD_DIR}/${target}.map
    COMMENT "Compiling map ${file}..."
      USES_TERMINAL
      DEPENDS ${DAWN_ASSETS}
  )
  add_dependencies(dawnassets ${target})
endfunction()