Merge pull request #686 from Azaezel/alpha40/cmakeAugs

modular source work
This commit is contained in:
Brian Roberts 2021-11-26 17:58:25 -06:00 committed by GitHub
commit 3c30a905c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 5 deletions

View file

@ -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
############################################################################### ###############################################################################

View file

@ -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...")