Make torque3d.cmake load all .cmake files from the module folder.

Move option code to each individual module.
This makes it so you can add a new module without having to modify the torque3d.cmake
This commit is contained in:
Scott Przybylski 2014-10-10 23:50:05 -07:00
parent 5103ba22e2
commit f527b45ec2
5 changed files with 73 additions and 80 deletions

View file

@ -20,22 +20,33 @@
# IN THE SOFTWARE.
# -----------------------------------------------------------------------------
# module OculusVR
# Source
addPathRec( "${srcDir}/platform/input/razerHydra" )
# module Hydra
# Includes
addInclude( "${TORQUE_RAZERHYDRA_SDK_PATH}/include" )
# Install
if( WIN32 )
# File Copy for Release
INSTALL(FILES "${TORQUE_RAZERHYDRA_SDK_PATH}/bin/win32/release_dll/sixense.dll" DESTINATION "${projectOutDir}")
# File Copy for Debug
INSTALL(FILES "${TORQUE_RAZERHYDRA_SDK_PATH}/bin/win32/debug_dll/sixensed.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Debug" )
# Only needed by the debug sixense library
INSTALL(FILES "${TORQUE_RAZERHYDRA_SDK_PATH}/samples/win32/sixense_simple3d/DeviceDLL.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Debug" )
option(TORQUE_HYDRA "Enable HYDRA module" OFF)
mark_as_advanced(TORQUE_HYDRA)
if(TORQUE_HYDRA)
if(TORQUE_HYDRA_SDK_PATH STREQUAL "")
set(TORQUE_HYDRA_SDK_PATH "" CACHE PATH "HYDRA library path" FORCE)
endif()
else() # hide variable
set(TORQUE_HYDRA_SDK_PATH "" CACHE INTERNAL "" FORCE)
endif()
if(TORQUE_HYDRA)
# Source
addPathRec( "${srcDir}/platform/input/razerHydra" )
# Includes
addInclude( "${TORQUE_RAZERHYDRA_SDK_PATH}/include" )
# Install
if( WIN32 )
# File Copy for Release
INSTALL(FILES "${TORQUE_RAZERHYDRA_SDK_PATH}/bin/win32/release_dll/sixense.dll" DESTINATION "${projectOutDir}")
# File Copy for Debug
INSTALL(FILES "${TORQUE_RAZERHYDRA_SDK_PATH}/bin/win32/debug_dll/sixensed.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Debug" )
# Only needed by the debug sixense library
INSTALL(FILES "${TORQUE_RAZERHYDRA_SDK_PATH}/samples/win32/sixense_simple3d/DeviceDLL.dll" DESTINATION "${projectOutDir}" CONFIGURATIONS "Debug" )
endif()
endif()