main.cs configuring now (optional), fixed installation up, fixed application name up, fixed executable name, added configured torsion template

This commit is contained in:
Thomas Fischer 2014-03-19 18:17:35 +01:00
parent cd727f7711
commit f3dbe07b9a
5 changed files with 614 additions and 20 deletions

View file

@ -1,6 +1,6 @@
project("Torque3DEngine")
set(TORQUE_TEMPLATE "Empty" CACHE STRING "the template to use")
set(TORQUE_TEMPLATE "Full" CACHE STRING "the template to use")
set(projectDir "${CMAKE_SOURCE_DIR}/My Projects/${TORQUE_APP_NAME}")
set(projectOutDir "${projectDir}/game")
@ -14,9 +14,6 @@ set(cmakeDir "${CMAKE_SOURCE_DIR}/Tools/CMake")
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${projectOutDir}/game)
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${projectOutDir}/game)
# change the default installation path to My Projects/app name
SET(CMAKE_INSTALL_PREFIX "${projectDir}" CACHE INTERNAL "Prefix prepended to install directories" FORCE)
# finds and adds sources files in a folder
macro(addPath dir)
set(tmpa "")
@ -117,12 +114,6 @@ endmacro()
# macro to add an executable
macro(addExecutable)
# more paths?
if(${ARGC} GREATER 0)
foreach(dir ${ARGV0})
addPath("${dir}")
endforeach()
endif()
# now inspect the paths we got
set(firstDir "")
foreach(dir ${${PROJECT_NAME}_paths})
@ -133,9 +124,7 @@ macro(addExecutable)
generateFilters("${firstDir}")
add_executable("${PROJECT_NAME}" WIN32 ${${PROJECT_NAME}_files})
# omg - only use the first folder ... otehrwise we get lots of header name collisions
#foreach(dir ${${PROJECT_NAME}_paths})
addInclude("${firstDir}")
#endforeach()
endmacro()

View file

@ -0,0 +1,39 @@
<TorsionProject>
<Name>@TORQUE_APP_NAME@</Name>
<WorkingDir/>
<EntryScript>main.cs</EntryScript>
<DebugHook>dbgSetParameters( #port#, "#password#", true );</DebugHook>
<Mods>
<Folder>core</Folder>
<Folder>scripts</Folder>
<Folder>art</Folder>
<Folder>levels</Folder>
<Folder>shaders</Folder>
<Folder>tools</Folder>
</Mods>
<ScannerExts>cs; gui</ScannerExts>
<Configs>
<Config>
<Name>Release</Name>
<Executable>@TORQUE_APP_NAME@.exe</Executable>
<Arguments/>
<HasExports>true</HasExports>
<Precompile>true</Precompile>
<InjectDebugger>true</InjectDebugger>
<UseSetModPaths>false</UseSetModPaths>
</Config>
<Config>
<Name>Debug</Name>
<Executable>@TORQUE_APP_NAME@.exe</Executable>
<Arguments/>
<HasExports>true</HasExports>
<Precompile>true</Precompile>
<InjectDebugger>true</InjectDebugger>
<UseSetModPaths>false</UseSetModPaths>
</Config>
</Configs>
<SearchURL/>
<SearchProduct>@TORQUE_APP_NAME@</SearchProduct>
<SearchVersion>HEAD</SearchVersion>
<ExecModifiedScripts>true</ExecModifiedScripts>
</TorsionProject>

View file

@ -1,4 +1,4 @@
project(torque3d)
project(${TORQUE_APP_NAME})
# TODO: fmod support
@ -317,12 +317,18 @@ endif()
if(NOT EXISTS "${projectSrcDir}/torque.ico")
CONFIGURE_FILE("${cmakeDir}/torque.ico" "${projectSrcDir}/torque.ico" COPYONLY)
endif()
if(NOT EXISTS "${projectOutDir}/${PROJECT_NAME}.torsion")
CONFIGURE_FILE("${cmakeDir}/template.torsion.in" "${projectOutDir}/${PROJECT_NAME}.torsion")
endif()
if(EXISTS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/main.cs.in" AND NOT EXISTS "${projectOutDir}/main.cs")
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/main.cs.in" "${projectOutDir}/main.cs")
endif()
if(WIN32)
if(NOT EXISTS "${projectSrcDir}/torque.rc")
CONFIGURE_FILE("${cmakeDir}/torque-win.rc.in" "${projectSrcDir}/torque.rc")
endif()
if(NOT EXISTS "${projectDir}/cleanup.bat")
CONFIGURE_FILE("${cmakeDir}/cleanup-win.bat.in" "${projectDir}/cleanup.bat")
if(NOT EXISTS "${projectOutDir}/cleanup.bat")
CONFIGURE_FILE("${cmakeDir}/cleanup-win.bat.in" "${projectOutDir}/cleanup.bat")
endif()
endif()
@ -435,12 +441,12 @@ endif()
###############################################################################
# Installation
###############################################################################
INSTALL_FILES(/ FILES ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game)
INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game" DESTINATION "${projectDir}")
if(WIN32)
INSTALL_FILES(/ FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/cleanShaders.bat")
INSTALL_FILES(/ FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeleteCachedDTSs.bat")
INSTALL_FILES(/ FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeleteDSOs.bat")
INSTALL_FILES(/ FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeletePrefs.bat")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/cleanShaders.bat" DESTINATION "${projectDir}")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeleteCachedDTSs.bat" DESTINATION "${projectDir}")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeleteDSOs.bat" DESTINATION "${projectDir}")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeletePrefs.bat" DESTINATION "${projectDir}")
endif()
INCLUDE(CPack)