Commit cd727f77 authored by Thomas Fischer's avatar Thomas Fischer

added lib template; added cleanup batch file; added game folder

parent e93a5d9d
cmake_minimum_required (VERSION 2.8)
project("Torque3D")
set(TORQUE_APP_NAME "My Project" CACHE STRING "the app name")
set(TORQUE_APP_VERSION "1000" CACHE STRING "the app version: major * 1000 + minor * 100 + revision * 10.")
set(TORQUE_APP_VERSION_STRING "1.0" CACHE STRING "the app version string")
project(${TORQUE_APP_NAME})
add_subdirectory(Tools/CMake)
\ No newline at end of file
......@@ -2,19 +2,20 @@ project("Torque3DEngine")
set(TORQUE_TEMPLATE "Empty" CACHE STRING "the template to use")
set(projectOutDir "${CMAKE_SOURCE_DIR}/My Projects/${TORQUE_APP_NAME}")
set(projectSrcDir "${CMAKE_SOURCE_DIR}/My Projects/${TORQUE_APP_NAME}/source")
set(projectDir "${CMAKE_SOURCE_DIR}/My Projects/${TORQUE_APP_NAME}")
set(projectOutDir "${projectDir}/game")
set(projectSrcDir "${projectDir}/source")
set(libDir "${CMAKE_SOURCE_DIR}/Engine/lib")
set(srcDir "${CMAKE_SOURCE_DIR}/Engine/source")
set(cmakeDir "${CMAKE_SOURCE_DIR}/Tools/CMake")
# output folders
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${projectOutDir}/bin)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${projectOutDir}/bin)
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${projectOutDir}/bin)
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${projectOutDir}/game)
#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 "${projectOutDir}" CACHE INTERNAL "Prefix prepended to install directories" FORCE)
SET(CMAKE_INSTALL_PREFIX "${projectDir}" CACHE INTERNAL "Prefix prepended to install directories" FORCE)
# finds and adds sources files in a folder
macro(addPath dir)
......@@ -174,7 +175,7 @@ if(MSVC)
FOREACH(CONF ${CMAKE_CONFIGURATION_TYPES})
# Go uppercase (DEBUG, RELEASE...)
STRING(TOUPPER "${CONF}" CONF)
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${projectOutDir}")
#SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${projectOutDir}")
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}" "${projectOutDir}")
ENDFOREACH()
endif()
@ECHO off
:: Delete procedural shaders
echo shaders
del /q /a:-R shaders\procedural\*.*
:: Delete dumped shader disassembly files
for /R %%a IN (*._dis.txt) do IF EXIST "%%a._dis.txt" del "%%a._dis.txt"
:: Delete fonts
echo fonts
del /q /a:-R core\fonts\*.*
:: CEF cache
echo browser cache
del /q /a:-R cache
:: the cached meshes and alike
echo meshes and alike
for /R %%a IN (*.dae) do IF EXIST "%%~pna.cached.dts" del "%%~pna.cached.dts"
for /R %%a IN (*.imposter*.dds) do del "%%a"
:: the torque script compilations
echo compiled script
for /R %%a IN (*.cs) do IF EXIST "%%a.dso" del "%%a.dso"
for /R %%a IN (*.cs) do IF EXIST "%%a.edso" del "%%a.edso"
for /R %%a IN (*.gui) do IF EXIST "%%a.dso" del "%%a.dso"
for /R %%a IN (*.gui) do IF EXIST "%%a.edso" del "%%a.edso"
for /R %%a IN (*.ts) do IF EXIST "%%a.dso" del "%%a.dso"
for /R %%a IN (*.ts) do IF EXIST "%%a.edso" del "%%a.edso"
:: the user settings and alike
echo settings
IF EXIST "prefs.cs" del /s prefs.cs
IF EXIST "core\prefs.cs" del /s core\prefs.cs
::IF EXIST "scripts\client\prefs.cs" del /s scripts\client\prefs.cs
IF EXIST "scripts\server\banlist.cs" del /s scripts\server\banlist.cs
IF EXIST "scripts\server\prefs.cs" del /s scripts\server\prefs.cs
IF EXIST "client\config.cs" del /s client\config.cs
IF EXIST "config.cs" del /s config.cs
IF EXIST "tools\settings.xml" del /s tools\settings.xml
IF EXIST "banlist.cs" del /s banlist.cs
:: logs
echo logs
IF EXIST "torque3d.log" del /s torque3d.log
echo DONE!
\ No newline at end of file
# this is a template file that should help you write a new cmake build script for a new library
# 1st thing: the project name
project(pcre)
# 2nd: add the paths where the source code is
addPath("${libDir}/pcre")
addPathRec("${libDir}/pcre")
# 3rd: add addStaticLib()
addStaticLib()
# then add definitions
addDef(PCRE_STATIC)
addDef(HAVE_CONFIG_H)
# and maybe more include paths
addInclude(${libDir}/libvorbis/include)
addInclude(${libDir}/libogg/include)
......@@ -62,9 +62,6 @@ option(TORQUE_DEBUG_GFX_MODE "triggers graphics debug mode" OFF)
mark_as_advanced(TORQUE_DEBUG_GFX_MODE)
#option(DEBUG_SPEW "more debug" OFF)
set(TORQUE_APP_NAME "Default" CACHE STRING "the app name")
set(TORQUE_APP_VERSION "1000" CACHE STRING "the app version: major * 1000 + minor * 100 + revision * 10.")
set(TORQUE_APP_VERSION_STRING "1.0" CACHE STRING "the app version string")
set(TORQUE_NO_DSO_GENERATION ON)
# warning C4800: 'XXX' : forcing value to bool 'true' or 'false' (performance warning)
......@@ -324,6 +321,9 @@ 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")
endif()
endif()
###############################################################################
......@@ -435,5 +435,12 @@ endif()
###############################################################################
# Installation
###############################################################################
#INSTALL_TARGETS(/ torque3d) # not needed anymore as we should directly build in there
INSTALL_FILES(/ FILES ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/)
INSTALL_FILES(/ FILES ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game)
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")
endif()
INCLUDE(CPack)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment