mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
modular source work
from @marauder2k7: augments the modular inclusion of sourcefiles via confining it to /source/ directories only to prevent strays. additionally, adds a /lib/ filter for full on library inclusion
This commit is contained in:
parent
13cd3de2ad
commit
1816b3ca0c
2 changed files with 29 additions and 28 deletions
|
|
@ -104,6 +104,20 @@ macro(addPathRec dir)
|
||||||
addPath("${dir}" "REC")
|
addPath("${dir}" "REC")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
### Gameplay Modules Lib Check
|
||||||
|
###############################################################################
|
||||||
|
macro(subDirCmake result curdir)
|
||||||
|
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
|
||||||
|
set(dirList "")
|
||||||
|
foreach(child ${children})
|
||||||
|
if(IS_DIRECTORY ${curdir}/${child})
|
||||||
|
LIST(APPEND dirList ${curdir}/${child})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(${result} ${dirList})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
### Definition Handling
|
### Definition Handling
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
|
||||||
|
|
@ -385,9 +385,19 @@ addPathRec("${projectSrcDir}")
|
||||||
if(EXISTS ${TORQUE_APP_DIR}/game/data)
|
if(EXISTS ${TORQUE_APP_DIR}/game/data)
|
||||||
message("Reading modules in ${TORQUE_APP_DIR}/game/data path...")
|
message("Reading modules in ${TORQUE_APP_DIR}/game/data path...")
|
||||||
|
|
||||||
addInclude("${TORQUE_APP_DIR}/game/data")
|
subDirCmake(MODULEDIRS ${TORQUE_APP_DIR}/game/data)
|
||||||
addPathRec("${TORQUE_APP_DIR}/game/data")
|
foreach(modDir ${MODULEDIRS})
|
||||||
|
addInclude("${modDir}/source")
|
||||||
|
addPathRec("${modDir}/source")
|
||||||
|
file(GLOB modules "${modDir}/lib/*.cmake")
|
||||||
|
foreach(module ${modules})
|
||||||
|
set(moduleLibDir "${modDir}/lib")
|
||||||
|
include(${module})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(EXISTS ${TORQUE_APP_DIR}/game/tools)
|
if(EXISTS ${TORQUE_APP_DIR}/game/tools)
|
||||||
message("Reading modules in ${TORQUE_APP_DIR}/game/tools path...")
|
message("Reading modules in ${TORQUE_APP_DIR}/game/tools path...")
|
||||||
|
|
||||||
|
|
@ -969,26 +979,3 @@ if(TORQUE_TEMPLATE)
|
||||||
INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeletePrefs.bat" DESTINATION "${TORQUE_APP_DIR}")
|
INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeletePrefs.bat" DESTINATION "${TORQUE_APP_DIR}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# Properties folder
|
|
||||||
###############################################################################
|
|
||||||
# we only need to add libs that we add via add_subdirectory command, basics.cmake
|
|
||||||
# will take care of the other source libs added via addLib
|
|
||||||
|
|
||||||
if(TORQUE_SFX_OPENAL AND WIN32)
|
|
||||||
set_target_properties(OpenAL PROPERTIES FOLDER ${TORQUE_LIBS_FOLDER_NAME})
|
|
||||||
#why is openal adding these two?
|
|
||||||
set_target_properties(common PROPERTIES FOLDER ${TORQUE_LIBS_FOLDER_NAME})
|
|
||||||
set_target_properties(ex-common PROPERTIES FOLDER ${TORQUE_LIBS_FOLDER_NAME})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(TORQUE_SDL)
|
|
||||||
# Apple config has slightly different target names
|
|
||||||
if (APPLE)
|
|
||||||
set_target_properties(SDL2main PROPERTIES FOLDER ${TORQUE_LIBS_FOLDER_NAME})
|
|
||||||
set_target_properties(SDL2-static PROPERTIES FOLDER ${TORQUE_LIBS_FOLDER_NAME})
|
|
||||||
else()
|
|
||||||
set_target_properties(SDL2 PROPERTIES FOLDER ${TORQUE_LIBS_FOLDER_NAME})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue