Commit 0ca4dc75 authored by Anders Dahnielson's avatar Anders Dahnielson

Improving CMake build system for power user

* Making it possible to override the project directory location
  by setting TORQUE_APP_DIR.

* Making it possible to skip template installation (copying) to
  project directory by setting TORQUE_TEMPLATE to OFF.
parent 69838bdc
......@@ -22,16 +22,17 @@
project("Torque3DEngine")
set(TORQUE_TEMPLATE "Full" CACHE STRING "the template to use")
if(NOT projectDir)
set(projectDir "${CMAKE_SOURCE_DIR}/My Projects/${TORQUE_APP_NAME}")
if(NOT TORQUE_TEMPLATE)
set(TORQUE_TEMPLATE "Full" CACHE STRING "the template to use")
endif()
if(NOT TORQUE_APP_DIR)
set(TORQUE_APP_DIR "${CMAKE_SOURCE_DIR}/My Projects/${TORQUE_APP_NAME}")
endif()
if(NOT projectOutDir)
set(projectOutDir "${projectDir}/game")
set(projectOutDir "${TORQUE_APP_DIR}/game")
endif()
if(NOT projectSrcDir)
set(projectSrcDir "${projectDir}/source")
set(projectSrcDir "${TORQUE_APP_DIR}/source")
endif()
set(libDir "${CMAKE_SOURCE_DIR}/Engine/lib")
set(srcDir "${CMAKE_SOURCE_DIR}/Engine/source")
......@@ -317,7 +318,7 @@ macro(setupPackaging)
SET(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME}")
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1)
SET(CPACK_OUTPUT_FILE_PREFIX "${projectDir}/packages/${PROJECT_NAME}")
SET(CPACK_OUTPUT_FILE_PREFIX "${TORQUE_APP_DIR}/packages/${PROJECT_NAME}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "")
#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
......
......@@ -575,11 +575,11 @@ endif()
if(TORQUE_TEMPLATE)
message("Prepare Template(${TORQUE_TEMPLATE}) install...")
INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game" DESTINATION "${projectDir}")
INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game" DESTINATION "${TORQUE_APP_DIR}")
if(WIN32)
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}")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/cleanShaders.bat" DESTINATION "${TORQUE_APP_DIR}")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeleteCachedDTSs.bat" DESTINATION "${TORQUE_APP_DIR}")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeleteDSOs.bat" DESTINATION "${TORQUE_APP_DIR}")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeletePrefs.bat" DESTINATION "${TORQUE_APP_DIR}")
endif()
endif()
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