Moved C++ tools out
This commit is contained in:
64
archive/dawntools/vnscenetool/CMakeLists.txt
Normal file
64
archive/dawntools/vnscenetool/CMakeLists.txt
Normal file
@ -0,0 +1,64 @@
|
||||
# Copyright (c) 2023 Dominic Msters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Texture Build Tool
|
||||
project(vnscenetool VERSION 1.0)
|
||||
add_executable(vnscenetool)
|
||||
|
||||
# Subdirs
|
||||
add_subdirectory(events)
|
||||
|
||||
# Sources
|
||||
target_sources(vnscenetool
|
||||
PRIVATE
|
||||
${DAWN_SHARED_SOURCES}
|
||||
${DAWN_TOOL_SOURCES}
|
||||
VNSceneTool.cpp
|
||||
VNSceneParser.cpp
|
||||
VNSceneGen.cpp
|
||||
VNSceneItemParser.cpp
|
||||
)
|
||||
|
||||
# Includes
|
||||
target_include_directories(vnscenetool
|
||||
PUBLIC
|
||||
${DAWN_SHARED_INCLUDES}
|
||||
${DAWN_TOOL_INCLUDES}
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
||||
|
||||
# Definitions
|
||||
target_compile_definitions(vnscenetool
|
||||
PUBLIC
|
||||
${DAWN_SHARED_DEFINITIONS}
|
||||
DAWN_TOOL_INSTANCE=VNSceneTool
|
||||
DAWN_TOOL_HEADER="VNSceneTool.hpp"
|
||||
)
|
||||
|
||||
# Libraries
|
||||
target_link_libraries(vnscenetool
|
||||
PUBLIC
|
||||
${DAWN_BUILD_HOST_LIBS}
|
||||
)
|
||||
|
||||
# Tool Function
|
||||
function(tool_vnscene in)
|
||||
set(DEPS "")
|
||||
if(DAWN_BUILD_TOOLS)
|
||||
set(DEPS vnscenetool)
|
||||
endif()
|
||||
|
||||
STRING(REGEX REPLACE "[\.|\\|\/|\:]" "-" scene_name ${in})
|
||||
add_custom_target(scene_${scene_name}
|
||||
COMMAND vnscenetool --input="${in}" --output="${DAWN_GENERATED_DIR}/generatedscenes"
|
||||
COMMENT "Generating vnscene from ${in}"
|
||||
DEPENDS ${DEPS}
|
||||
)
|
||||
target_include_directories(${DAWN_TARGET_NAME}
|
||||
PUBLIC
|
||||
${DAWN_GENERATED_DIR}/generatedscenes
|
||||
)
|
||||
add_dependencies(${DAWN_TARGET_NAME} scene_${scene_name})
|
||||
endfunction()
|
Reference in New Issue
Block a user