Dawn/src/dawntools/display/CMakeLists.txt

50 lines
1.6 KiB
CMake

# Copyright (c) 2021 Dominic Msters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
add_subdirectory(texturegen)
add_subdirectory(tilesetgen)
add_subdirectory(truetypegen)
add_subdirectory(uigen)
# Texture Tool
function(tool_texture target in)
add_custom_target(${target}
COMMAND texturegen "${DAWN_ASSETS_SOURCE_DIR}/${in}" "${DAWN_ASSETS_BUILD_DIR}/${target}"
COMMENT "Generating texture ${target} from ${in}"
DEPENDS texturegen
)
endfunction()
# Tileset Tool
function(tool_tileset targetTileset targetTexture in cols rows)
tool_texture(${targetTexture} ${in})
add_custom_target(${targetTileset}
COMMAND tilesetgen "${DAWN_ASSETS_SOURCE_DIR}/${in}" "${DAWN_ASSETS_BUILD_DIR}/${targetTileset}" "${cols}" "${rows}"
COMMENT "Generating tileset ${target} from ${in}"
DEPENDS tilesetgen ${targetTexture}
)
endfunction()
# TrueType Tool
function(tool_truetype target in out width height fontSize)
add_custom_target(${target}
COMMAND truetypegen "${DAWN_ASSETS_SOURCE_DIR}/${in}" "${DAWN_ASSETS_BUILD_DIR}/${out}" "${width}" "${height}" "${fontSize}"
COMMENT "Generating truetype ${target} from ${in}"
DEPENDS truetypegen
)
endfunction()
# UI Tool
function(tool_ui target in)
add_custom_target(${target}
COMMAND uigen "${DAWN_ASSETS_SOURCE_DIR}/${in}" "${DAWN_GENERATED_DIR}/ui/${target}"
COMMENT "Generating ui ${target} from ${in}"
DEPENDS uigen
)
target_include_directories(${DAWN_TARGET_NAME}
PUBLIC
${DAWN_GENERATED_DIR}/ui
)
endfunction()