Started fixing texture tool (incomplete)

This commit is contained in:
2023-04-02 17:15:49 -07:00
parent 7cb9846e1b
commit b3f58ed0ec
14 changed files with 304 additions and 11 deletions

View File

@ -0,0 +1,53 @@
# Copyright (c) 2021 Dominic Msters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Texture Build Tool
project(texturetool VERSION 1.0)
add_executable(texturetool)
target_sources(texturetool
PRIVATE
${DAWN_SHARED_SOURCES}
${DAWN_TOOL_SOURCES}
TextureTool.cpp
../util/Image.cpp
)
target_include_directories(texturetool
PUBLIC
${DAWN_SHARED_INCLUDES}
${DAWN_TOOL_INCLUDES}
${CMAKE_CURRENT_LIST_DIR}
)
# Definitions
target_compile_definitions(texturetool
PUBLIC
${DAWN_SHARED_DEFINITIONS}
DAWN_TOOL_INSTANCE=TextureTool
DAWN_TOOL_HEADER="TextureTool.hpp"
)
# Libraries
target_link_libraries(texturetool
PUBLIC
${DAWN_BUILD_HOST_LIBS}
stb
)
# Tool Function
function(tool_texture target in)
set(DEPS "")
if(DAWN_BUILD_TOOLS)
set(DEPS texturetool)
endif()
add_custom_target(${target}
COMMAND texturetool --input="${DAWN_ASSETS_SOURCE_DIR}/${in}" --output="${DAWN_ASSETS_BUILD_DIR}/${target}"
COMMENT "Generating texture ${target} from ${in}"
DEPENDS ${DEPS}
)
add_dependencies(${DAWN_TARGET_NAME} ${target})
endfunction()