cmake improvements: correct build folder without installing, merged luis resource copy fix. fixed usage of the app name. added source folder to build configuration

This commit is contained in:
Thomas Fischer 2014-03-19 02:03:45 +01:00
parent 0dc0e70114
commit 5ffe7abee9
2 changed files with 40 additions and 14 deletions

View file

@ -2,17 +2,18 @@ project("Torque3DEngine")
set(TORQUE_TEMPLATE "Empty" CACHE STRING "the template to use")
set(projectOutDir "${CMAKE_SOURCE_DIR}/My Projects/${TORQUE_TEMPLATE}")
set(projectSrcDir "${CMAKE_SOURCE_DIR}/My Projects/${TORQUE_TEMPLATE}/source")
set(libDir "${CMAKE_SOURCE_DIR}/Engine/lib")
set(srcDir "${CMAKE_SOURCE_DIR}/Engine/source")
set(cmakeDir "${CMAKE_SOURCE_DIR}/Tools/CMake")
set(projectOutDir "${CMAKE_SOURCE_DIR}/My Projects/${TORQUE_APP_NAME}")
set(projectSrcDir "${CMAKE_SOURCE_DIR}/My Projects/${TORQUE_APP_NAME}/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}/bin)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${projectOutDir}/bin)
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${projectOutDir}/bin)
# change the default installation path to My Projects/app name
SET(CMAKE_INSTALL_PREFIX "${projectOutDir}" CACHE INTERNAL "Prefix prepended to install directories" FORCE)
# finds and adds sources files in a folder
@ -156,4 +157,12 @@ if(WIN32)
endif()
# fix the debug/release subfolders on windows
if(MSVC)
FOREACH(CONF ${CMAKE_CONFIGURATION_TYPES})
# Go uppercase (DEBUG, RELEASE...)
STRING(TOUPPER "${CONF}" CONF)
#SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${projectOutDir}")
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}" "${projectOutDir}")
ENDFOREACH()
endif()

View file

@ -139,6 +139,7 @@ addPath("${srcDir}/T3D/turret")
addPath("${srcDir}/main/")
addPathRec("${srcDir}/ts/collada")
addPathRec("${srcDir}/ts/loader")
addFile("${projectSrcDir}")
###############################################################################
# modular paths
@ -213,7 +214,7 @@ if(WIN32)
addPath("${srcDir}/terrain/hlsl")
addPath("${srcDir}/forest/hlsl")
# add windows rc file for the icon
addFile("${projectSrcDir}/torque-win.rc")
addFile("${projectSrcDir}/torque.rc")
endif()
if(APPLE)
@ -279,18 +280,34 @@ addExecutable()
###############################################################################
###############################################################################
# configure only once
# configure file relevant files only once
if(NOT EXISTS ${projectSrcDir}/torqueConfig.h)
message(STATUS "writing ${projectSrcDir}/torqueConfig.h")
CONFIGURE_FILE(${cmakeDir}/torqueConfig.h.in ${projectSrcDir}/torqueConfig.h)
CONFIGURE_FILE(${cmakeDir}/torque-win.rc.in ${projectSrcDir}/torque-win.rc)
endif()
if(NOT EXISTS ${projectSrcDir}/torque.ico)
CONFIGURE_FILE(${cmakeDir}/torque.ico ${projectSrcDir}/torque.ico COPYONLY)
endif()
if(WIN32)
if(NOT EXISTS ${projectSrcDir}/torque.rc)
CONFIGURE_FILE(${cmakeDir}/torque-win.rc.in ${projectSrcDir}/torque.rc)
endif()
endif()
###############################################################################
# Common Libraries
###############################################################################
addLib("lmng;lpng;lungif;ljpeg;zlib;tinyxml;opcode;squish;collada;pcre;convexDecomp")
addLib(lmng)
addLib(lpng)
addLib(lungif)
addLib(ljpeg)
addLib(zlib)
addLib(tinyxml)
addLib(opcode)
addLib(squish)
addLib(collada)
addLib(pcre)
addLib(convexDecomp)
if(WIN32)
# copy pasted from T3D build system, some might not be needed
@ -384,5 +401,5 @@ endif()
###############################################################################
# Installation
###############################################################################
INSTALL_TARGETS(/ torque3d)
#INSTALL_TARGETS(/ torque3d) # not needed anymore as we should directly build in there
INSTALL_FILES(/ FILES ${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/)