Torque3D/Templates/BaseGame/CMakeLists.txt
Robert MacGregor b23554295c * BugFix: Correct some errors in the module scripts.
* BugFix: Fixes for compiling on Windows.
2022-05-21 18:07:14 -04:00

22 lines
1 KiB
CMake

file(GLOB TEMPLATE_FILES "*.bat" "*.command")
install(FILES ${TEMPLATE_FILES} DESTINATION .)
# Perform installation minus scripts
install(DIRECTORY "game" "source" DESTINATION .
PATTERN "*.tscript"
EXCLUDE PATTERN)
# Enumerate scripts and install with extension
file(GLOB_RECURSE SCRIPT_FILES "game/*.tscript")
foreach(ITEM ${SCRIPT_FILES})
get_filename_component( dir ${ITEM} DIRECTORY )
get_filename_component( scriptName ${ITEM} NAME )
STRING(REGEX REPLACE "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/" "${CMAKE_INSTALL_PREFIX}/" INSTALL_DIR ${dir})
STRING(REGEX REPLACE ".tscript" ".${TORQUE_SCRIPT_EXTENSION}" newScriptName ${scriptName})
install( FILES ${ITEM} DESTINATION ${INSTALL_DIR} RENAME ${newScriptName} )
endforeach()
# Once the full tree is installed, perform configurations on several files
CONFIGURE_FILE("game/main.tscript.in" "${CMAKE_BINARY_DIR}/main.${TORQUE_SCRIPT_EXTENSION}")
install(FILES "${CMAKE_BINARY_DIR}/main.${TORQUE_SCRIPT_EXTENSION}" DESTINATION "${CMAKE_INSTALL_PREFIX}/game")