mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Clean CMake files.
This commit is contained in:
parent
492f217330
commit
8a50895062
|
|
@ -2,27 +2,7 @@ include(basics.cmake)
|
|||
|
||||
setupVersionNumbers()
|
||||
|
||||
#the libs
|
||||
include(libraries/lmng.cmake)
|
||||
include(libraries/lpng.cmake)
|
||||
include(libraries/lungif.cmake)
|
||||
include(libraries/zlib.cmake)
|
||||
include(libraries/ljpeg.cmake)
|
||||
include(libraries/tinyxml.cmake)
|
||||
include(libraries/opcode.cmake)
|
||||
include(libraries/squish.cmake)
|
||||
include(libraries/collada.cmake)
|
||||
include(libraries/pcre.cmake)
|
||||
include(libraries/convexDecomp.cmake)
|
||||
if(TORQUE_SFX_VORBIS)
|
||||
include(libraries/libvorbis.cmake)
|
||||
include(libraries/libogg.cmake)
|
||||
endif()
|
||||
if(TORQUE_THEORA)
|
||||
include(libraries/libtheora.cmake)
|
||||
endif()
|
||||
|
||||
# the main engine, should come last
|
||||
include(torque3d.cmake)
|
||||
|
||||
#setupPackaging()
|
||||
#setupPackaging()
|
||||
|
|
@ -15,7 +15,6 @@ set(libDir "${CMAKE_SOURCE_DIR}/Engine/lib")
|
|||
set(srcDir "${CMAKE_SOURCE_DIR}/Engine/source")
|
||||
set(cmakeDir "${CMAKE_SOURCE_DIR}/Tools/CMake")
|
||||
|
||||
|
||||
# hide some things
|
||||
mark_as_advanced(CMAKE_INSTALL_PREFIX)
|
||||
mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
|
||||
|
|
@ -25,18 +24,25 @@ mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
|
|||
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${projectOutDir}/game)
|
||||
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${projectOutDir}/game)
|
||||
|
||||
###############################################################################
|
||||
### Source File Handling
|
||||
###############################################################################
|
||||
|
||||
# finds and adds sources files in a folder
|
||||
macro(addPath dir)
|
||||
set(tmpa "")
|
||||
file(GLOB tmpa
|
||||
set(tmp_files "")
|
||||
set(glob_config GLOB)
|
||||
if(${ARGC} GREATER 1 AND "${ARGV1}" STREQUAL "REC")
|
||||
set(glob_config GLOB_RECURSE)
|
||||
endif()
|
||||
file(${glob_config} tmp_files
|
||||
${dir}/*.cpp
|
||||
${dir}/*.c
|
||||
${dir}/*.cc
|
||||
${dir}/*.h)
|
||||
LIST(APPEND ${PROJECT_NAME}_files "${tmpa}")
|
||||
LIST(APPEND ${PROJECT_NAME}_files "${tmp_files}")
|
||||
LIST(APPEND ${PROJECT_NAME}_paths "${dir}")
|
||||
#message(STATUS "addPath ${PROJECT_NAME} : ${tmpa}")
|
||||
#set(t "${${t}};${tmpa}")
|
||||
#message(STATUS "addPath ${PROJECT_NAME} : ${tmp_files}")
|
||||
endmacro()
|
||||
|
||||
# adds a file to the sources
|
||||
|
|
@ -47,111 +53,115 @@ endmacro()
|
|||
|
||||
# finds and adds sources files in a folder recursively
|
||||
macro(addPathRec dir)
|
||||
set(tmpa "")
|
||||
file(GLOB_RECURSE tmpa
|
||||
${dir}/*.cpp
|
||||
${dir}/*.c
|
||||
${dir}/*.cc
|
||||
${dir}/*.h)
|
||||
LIST(APPEND ${PROJECT_NAME}_files "${tmpa}")
|
||||
LIST(APPEND ${PROJECT_NAME}_paths "${dir}")
|
||||
#message(STATUS "addPathRec ${PROJECT_NAME} : ${tmpa}")
|
||||
addPath("${dir}" "REC")
|
||||
endmacro()
|
||||
|
||||
# adds a definition
|
||||
###############################################################################
|
||||
### Definition Handling
|
||||
###############################################################################
|
||||
macro(__addDef def config)
|
||||
# two possibilities: a) target already known, so add it directly, or b) target not yet known, so add it to its cache
|
||||
if(TARGET ${PROJECT_NAME})
|
||||
#message(STATUS "directly applying defs: ${PROJECT_NAME} with config ${config}: ${def}")
|
||||
if("${config}" STREQUAL "")
|
||||
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS "${def}")
|
||||
else()
|
||||
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS_${config} "${def}")
|
||||
endif()
|
||||
else()
|
||||
list(APPEND ${PROJECT_NAME}_defs_${config} ${def})
|
||||
#message(STATUS "added definition to cache: ${PROJECT_NAME}_defs_${config}: ${${PROJECT_NAME}_defs_${config}}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# adds a definition: argument 1: Nothing(for all), _DEBUG, _RELEASE, <more build configurations>
|
||||
macro(addDef def)
|
||||
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS "${def}")
|
||||
endmacro()
|
||||
# adds a definition
|
||||
macro(addDebugDef def)
|
||||
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG "${def}")
|
||||
set(def_configs "")
|
||||
if(${ARGC} GREATER 1)
|
||||
foreach(config "${ARGV1}")
|
||||
__addDef(${def} ${config})
|
||||
endforeach()
|
||||
else()
|
||||
__addDef(${def} "")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# adds a required definition. Are processed on addExecutable or addStaticLib
|
||||
macro(addRequiredDefinition def)
|
||||
#message(STATUS "${PROJECT_NAME} : add def : ${def}")
|
||||
LIST( APPEND ${PROJECT_NAME}_required_definition ${def} )
|
||||
endmacro()
|
||||
# adds a required debug definition. Are processed on addExecutable or addStaticLib
|
||||
macro(addRequiredDebugDefinition def)
|
||||
#message(STATUS "${PROJECT_NAME} : add def : ${def}")
|
||||
LIST( APPEND ${PROJECT_NAME}_required_debug_definition ${def} )
|
||||
# this applies cached definitions onto the target
|
||||
macro(_process_defs)
|
||||
if(DEFINED ${PROJECT_NAME}_defs_)
|
||||
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS "${${PROJECT_NAME}_defs_}")
|
||||
#message(STATUS "applying defs to project ${PROJECT_NAME} on all configs: ${${PROJECT_NAME}_defs_}")
|
||||
endif()
|
||||
foreach(def_config ${CMAKE_CONFIGURATION_TYPES})
|
||||
string(TOUPPER "${def_config}" def_config)
|
||||
if(DEFINED ${PROJECT_NAME}_defs_${def_config})
|
||||
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS_${def_config} "${${PROJECT_NAME}_defs_${def_config}}")
|
||||
#message(STATUS "applying defs to project ${PROJECT_NAME} on config ${def_config}: ${${PROJECT_NAME}_defs_${def_config}}")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# add definitions to project
|
||||
macro( _processProjectDefinition )
|
||||
foreach( def ${${PROJECT_NAME}_required_definition} )
|
||||
addDef( ${def} )
|
||||
endforeach()
|
||||
|
||||
foreach( def ${${PROJECT_NAME}_required_debug_definition} )
|
||||
addDebugDef( ${def} )
|
||||
###############################################################################
|
||||
### Source Library Handling
|
||||
###############################################################################
|
||||
macro(addLibSrc libPath)
|
||||
set(cached_project_name ${PROJECT_NAME})
|
||||
include(${libPath})
|
||||
project(${cached_project_name})
|
||||
endmacro()
|
||||
|
||||
###############################################################################
|
||||
### Linked Library Handling
|
||||
###############################################################################
|
||||
macro(addLib libs)
|
||||
foreach(lib ${libs})
|
||||
# check if we can build it ourselfs
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake")
|
||||
addLibSrc("${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake")
|
||||
endif()
|
||||
# then link against it
|
||||
# two possibilities: a) target already known, so add it directly, or b) target not yet known, so add it to its cache
|
||||
if(TARGET ${PROJECT_NAME})
|
||||
target_link_libraries(${PROJECT_NAME} "${lib}")
|
||||
else()
|
||||
list(APPEND ${PROJECT_NAME}_libs ${lib})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
#clear required defs
|
||||
set( ${PROJECT_NAME}_required_definition )
|
||||
set( ${PROJECT_NAME}_required_debug_definition )
|
||||
endmacro()
|
||||
|
||||
# adds an include path
|
||||
# this applies cached definitions onto the target
|
||||
macro(_process_libs)
|
||||
if(DEFINED ${PROJECT_NAME}_libs)
|
||||
target_link_libraries(${PROJECT_NAME} "${${PROJECT_NAME}_libs}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
###############################################################################
|
||||
### Include Handling
|
||||
###############################################################################
|
||||
macro(addInclude incPath)
|
||||
#message(STATUS "${PROJECT_NAME} : add include path : ${incPath}")
|
||||
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY INCLUDE_DIRECTORIES "${incPath}")
|
||||
if(TARGET ${PROJECT_NAME})
|
||||
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY INCLUDE_DIRECTORIES "${incPath}")
|
||||
else()
|
||||
list(APPEND ${PROJECT_NAME}_includes ${incPath})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# adds a library to link against
|
||||
macro(addLib lib)
|
||||
#message(STATUS "${PROJECT_NAME} : add lib : ${lib}")
|
||||
target_link_libraries(${PROJECT_NAME} "${lib}")
|
||||
# this applies cached definitions onto the target
|
||||
macro(_process_includes)
|
||||
if(DEFINED ${PROJECT_NAME}_includes)
|
||||
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY INCLUDE_DIRECTORIES "${${PROJECT_NAME}_includes}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# adds a library dependency. Are processed on addExecutable or addStaticLib
|
||||
macro(addRequiredLibrary lib)
|
||||
#message(STATUS "${PROJECT_NAME} : add lib : ${lib}")
|
||||
LIST( APPEND ${PROJECT_NAME}_required_library ${lib} )
|
||||
endmacro()
|
||||
###############################################################################
|
||||
|
||||
# adds a link dependency. Are processed on addExecutable or addStaticLib
|
||||
macro(addRequiredLink lib)
|
||||
#message(STATUS "${PROJECT_NAME} : add lib : ${lib}")
|
||||
LIST( APPEND ${PROJECT_NAME}_required_link ${lib} )
|
||||
macro(_postTargetProcess)
|
||||
_process_includes()
|
||||
_process_defs()
|
||||
_process_libs()
|
||||
endmacro()
|
||||
|
||||
macro( _processProjectLibrary )
|
||||
# Append currect project to PROJECT_STACK
|
||||
LIST( APPEND PROJECT_STACK "${PROJECT_NAME}" )
|
||||
|
||||
foreach( lib ${${PROJECT_NAME}_required_library} )
|
||||
#message( "adding library dependency: ${lib}" )
|
||||
include( ${lib} )
|
||||
endforeach()
|
||||
|
||||
#clear required libraries
|
||||
set( ${PROJECT_NAME}_required_library )
|
||||
|
||||
# pop currect project form PROJECT_STACK
|
||||
LIST(REMOVE_AT PROJECT_STACK -1)
|
||||
|
||||
# get currect project form stack
|
||||
if( PROJECT_STACK )
|
||||
LIST(GET PROJECT_STACK -1 TEMP_PROJECT)
|
||||
project( ${TEMP_PROJECT} )
|
||||
endif()
|
||||
|
||||
|
||||
endmacro()
|
||||
|
||||
macro( _processProjectLinks )
|
||||
#message( "_processProjectLinks: ${PROJECT_NAME}" )
|
||||
foreach( lib ${${PROJECT_NAME}_required_link} )
|
||||
addLib( ${lib} )
|
||||
endforeach()
|
||||
|
||||
#clear required libraries
|
||||
set( ${PROJECT_NAME}_required_link )
|
||||
endmacro()
|
||||
|
||||
|
||||
# adds a path to search for libs
|
||||
macro(addLibPath dir)
|
||||
link_directories(${dir})
|
||||
|
|
@ -163,7 +173,7 @@ macro(generateFilters relDir)
|
|||
# Get the path of the file relative to ${DIRECTORY},
|
||||
# then alter it (not compulsory)
|
||||
file(RELATIVE_PATH SRCGR ${relDir} ${f})
|
||||
set(SRCGR "${PROJECT_NAME}/${SRCGR}")
|
||||
set(SRCGR "${PROJECT_NAME}/${SRCGR}")
|
||||
# Extract the folder, ie remove the filename part
|
||||
string(REGEX REPLACE "(.*)(/[^/]*)$" "\\1" SRCGR ${SRCGR})
|
||||
# do not have any ../ dirs
|
||||
|
|
@ -182,7 +192,7 @@ macro(generateFiltersSpecial relDir)
|
|||
# Get the path of the file relative to ${DIRECTORY},
|
||||
# then alter it (not compulsory)
|
||||
file(RELATIVE_PATH SRCGR ${relDir} ${f})
|
||||
set(SRCGR "torque3d/${SRCGR}")
|
||||
set(SRCGR "torque3d/${SRCGR}")
|
||||
# Extract the folder, ie remove the filename part
|
||||
string(REGEX REPLACE "(.*)(/[^/]*)$" "\\1" SRCGR ${SRCGR})
|
||||
# do not have any ../ dirs
|
||||
|
|
@ -200,8 +210,9 @@ macro(generateFiltersSpecial relDir)
|
|||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# macro to add a static library
|
||||
macro(addStaticLib)
|
||||
macro(finishLibrary)
|
||||
# more paths?
|
||||
if(${ARGC} GREATER 0)
|
||||
foreach(dir ${ARGV0})
|
||||
|
|
@ -216,23 +227,30 @@ macro(addStaticLib)
|
|||
endif()
|
||||
endforeach()
|
||||
generateFilters("${firstDir}")
|
||||
|
||||
# set per target compile flags
|
||||
if(TORQUE_CXX_FLAGS_${PROJECT_NAME})
|
||||
set_source_files_properties(${${PROJECT_NAME}_files} PROPERTIES COMPILE_FLAGS "${TORQUE_CXX_FLAGS_${PROJECT_NAME}}")
|
||||
else()
|
||||
set_source_files_properties(${${PROJECT_NAME}_files} PROPERTIES COMPILE_FLAGS "${TORQUE_CXX_FLAGS_LIBS}")
|
||||
endif()
|
||||
|
||||
if(TORQUE_STATIC)
|
||||
add_library("${PROJECT_NAME}" STATIC ${${PROJECT_NAME}_files})
|
||||
else()
|
||||
add_library("${PROJECT_NAME}" SHARED ${${PROJECT_NAME}_files})
|
||||
endif()
|
||||
# omg - only use the first folder ... otehrwise we get lots of header name collisions
|
||||
|
||||
# omg - only use the first folder ... otherwise we get lots of header name collisions
|
||||
#foreach(dir ${${PROJECT_NAME}_paths})
|
||||
addInclude("${firstDir}")
|
||||
#endforeach()
|
||||
|
||||
_processProjectLinks()
|
||||
_processProjectLibrary()
|
||||
_processProjectDefinition()
|
||||
|
||||
_postTargetProcess()
|
||||
endmacro()
|
||||
|
||||
# macro to add an executable
|
||||
macro(addExecutable)
|
||||
macro(finishExecutable)
|
||||
# now inspect the paths we got
|
||||
set(firstDir "")
|
||||
foreach(dir ${${PROJECT_NAME}_paths})
|
||||
|
|
@ -241,13 +259,18 @@ macro(addExecutable)
|
|||
endif()
|
||||
endforeach()
|
||||
generateFiltersSpecial("${firstDir}")
|
||||
|
||||
# set per target compile flags
|
||||
if(TORQUE_CXX_FLAGS_${PROJECT_NAME})
|
||||
set_source_files_properties(${${PROJECT_NAME}_files} PROPERTIES COMPILE_FLAGS "${TORQUE_CXX_FLAGS_${PROJECT_NAME}}")
|
||||
else()
|
||||
set_source_files_properties(${${PROJECT_NAME}_files} PROPERTIES COMPILE_FLAGS "${TORQUE_CXX_FLAGS_EXECUTABLES}")
|
||||
endif()
|
||||
|
||||
add_executable("${PROJECT_NAME}" WIN32 ${${PROJECT_NAME}_files})
|
||||
# omg - only use the first folder ... otehrwise we get lots of header name collisions
|
||||
addInclude("${firstDir}")
|
||||
|
||||
_processProjectLinks()
|
||||
_processProjectLibrary()
|
||||
_processProjectDefinition()
|
||||
|
||||
_postTargetProcess()
|
||||
endmacro()
|
||||
|
||||
macro(setupVersionNumbers)
|
||||
|
|
@ -287,13 +310,20 @@ set(TORQUE_STATIC ON)
|
|||
#option(TORQUE_STATIC "enables or disable static" OFF)
|
||||
|
||||
if(WIN32)
|
||||
set(TORQUE_CXX_FLAGS "/MP /O2 /Ob2 /Oi /Ot /Oy /GT /Zi /W4 /nologo /GF /EHsc /GS- /Gy- /Qpar- /arch:SSE2 /fp:fast /fp:except- /GR /Zc:wchar_t- /wd4018 /wd4100 /wd4121 /wd4127 /wd4130 /wd4244 /wd4245 /wd4389 /wd4511 /wd4512 /wd4800 /wd4995 /D_CRT_SECURE_NO_WARNINGS " CACHE TYPE STRING)
|
||||
mark_as_advanced(TORQUE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORQUE_CXX_FLAGS}")
|
||||
set(TORQUE_CXX_FLAGS_EXECUTABLES "/wd4018 /wd4100 /wd4121 /wd4127 /wd4130 /wd4244 /wd4245 /wd4389 /wd4511 /wd4512 /wd4800 /wd4995 " CACHE TYPE STRING)
|
||||
mark_as_advanced(TORQUE_CXX_FLAGS_EXECUTABLES)
|
||||
|
||||
set(TORQUE_CXX_FLAGS_LIBS "/W0" CACHE TYPE STRING)
|
||||
mark_as_advanced(TORQUE_CXX_FLAGS_LIBS)
|
||||
|
||||
set(TORQUE_CXX_FLAGS_COMMON "-DUNICODE -D_UNICODE /MP /O2 /Ob2 /Oi /Ot /Oy /GT /Zi /W4 /nologo /GF /EHsc /GS- /Gy- /Qpar- /arch:SSE2 /fp:fast /fp:except- /GR /Zc:wchar_t- /D_CRT_SECURE_NO_WARNINGS" CACHE TYPE STRING)
|
||||
mark_as_advanced(TORQUE_CXX_FLAGS_COMMON)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORQUE_CXX_FLAGS_COMMON}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "/LARGEADDRESSAWARE")
|
||||
#set(STATIC_LIBRARY_FLAGS "/OPT:NOREF")
|
||||
|
||||
|
||||
# Force static runtime libraries
|
||||
if(TORQUE_STATIC)
|
||||
FOREACH(flag
|
||||
|
|
@ -309,6 +339,16 @@ if(WIN32)
|
|||
SET("${flag}" "${${flag}} /EHsc")
|
||||
ENDFOREACH()
|
||||
endif()
|
||||
else()
|
||||
# TODO: improve default settings on other platforms
|
||||
set(TORQUE_CXX_FLAGS_EXECUTABLES "" CACHE TYPE STRING)
|
||||
mark_as_advanced(TORQUE_CXX_FLAGS_EXECUTABLES)
|
||||
set(TORQUE_CXX_FLAGS_LIBS "" CACHE TYPE STRING)
|
||||
mark_as_advanced(TORQUE_CXX_FLAGS_LIBS)
|
||||
set(TORQUE_CXX_FLAGS_COMMON "" CACHE TYPE STRING)
|
||||
mark_as_advanced(TORQUE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORQUE_CXX_FLAGS}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -44,4 +44,4 @@ IF EXIST "banlist.cs" del /s banlist.cs
|
|||
:: logs
|
||||
echo logs
|
||||
IF EXIST "torque3d.log" del /s torque3d.log
|
||||
echo DONE!
|
||||
echo DONE!
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ addPath("${libDir}/collada/src/modules/LIBXMLPlugin")
|
|||
addPath("${libDir}/collada/src/modules/stdErrPlugin")
|
||||
addPath("${libDir}/collada/src/modules/STLDatabase")
|
||||
|
||||
addStaticLib()
|
||||
|
||||
addDef(DOM_INCLUDE_TINYXML)
|
||||
addDef(PCRE_STATIC)
|
||||
|
||||
|
|
@ -15,3 +13,5 @@ addInclude(${libDir}/collada/include)
|
|||
addInclude(${libDir}/collada/include/1.4)
|
||||
addInclude(${libDir}/pcre)
|
||||
addInclude(${libDir}/tinyxml)
|
||||
|
||||
finishLibrary()
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
project(convexDecomp)
|
||||
|
||||
addStaticLib("${libDir}/convexDecomp")
|
||||
finishLibrary("${libDir}/convexDecomp")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
project(libogg)
|
||||
|
||||
addPathRec("${libDir}/libogg")
|
||||
|
||||
addStaticLib()
|
||||
addPath("${libDir}/libogg" REC)
|
||||
|
||||
addInclude(${libDir}/libogg/include)
|
||||
|
||||
finishLibrary()
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ project(libtheora)
|
|||
|
||||
addPathRec("${libDir}/libtheora")
|
||||
|
||||
addStaticLib()
|
||||
|
||||
addDef(TORQUE_OGGTHEORA)
|
||||
addDef(TORQUE_OGGVORIBS)
|
||||
addInclude(${libDir}/libogg/include)
|
||||
addInclude(${libDir}/libtheora/include)
|
||||
|
||||
finishLibrary()
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ project(libvorbis)
|
|||
|
||||
addPathRec("${libDir}/libvorbis")
|
||||
|
||||
addStaticLib()
|
||||
|
||||
addDef(TORQUE_OGGVORBIS)
|
||||
addInclude(${libDir}/libvorbis/include)
|
||||
addInclude(${libDir}/libogg/include)
|
||||
|
||||
finishLibrary()
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
project(ljpeg)
|
||||
|
||||
addStaticLib("${libDir}/ljpeg")
|
||||
finishLibrary("${libDir}/ljpeg")
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
project(lmng)
|
||||
|
||||
addStaticLib("${libDir}/${PROJECT_NAME}")
|
||||
|
||||
addDef(MNG_OPTIMIZE_OBJCLEANUP)
|
||||
|
||||
addInclude(${libDir}/lpng)
|
||||
addInclude(${libDir}/zlib)
|
||||
addInclude(${libDir}/ljpeg)
|
||||
|
||||
finishLibrary("${libDir}/${PROJECT_NAME}")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
project(lpng)
|
||||
|
||||
addStaticLib("${libDir}/${PROJECT_NAME}")
|
||||
|
||||
# addDef(PNG_NO_ASSEMBLER_CODE)
|
||||
|
||||
addInclude(${libDir}/zlib)
|
||||
|
||||
finishLibrary("${libDir}/${PROJECT_NAME}")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
project(lungif)
|
||||
|
||||
addStaticLib("${libDir}/${PROJECT_NAME}")
|
||||
|
||||
addDef(_GBA_NO_FILEIO)
|
||||
|
||||
|
||||
finishLibrary("${libDir}/${PROJECT_NAME}")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ project(opcode)
|
|||
addPath("${libDir}/${PROJECT_NAME}")
|
||||
addPath("${libDir}/${PROJECT_NAME}/Ice")
|
||||
|
||||
addStaticLib()
|
||||
|
||||
addDef(TORQUE_OPCODE)
|
||||
addDef(ICE_NO_DLL)
|
||||
|
||||
finishLibrary()
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
project(pcre)
|
||||
|
||||
addStaticLib("${libDir}/pcre")
|
||||
|
||||
addDef(PCRE_STATIC)
|
||||
addDef(HAVE_CONFIG_H)
|
||||
|
||||
set_property(TARGET pcre PROPERTY COMPILE_FLAGS /TP) #/TP = compile as C++
|
||||
finishLibrary("${libDir}/pcre")
|
||||
|
||||
if(WIN32)
|
||||
set_property(TARGET pcre PROPERTY COMPILE_FLAGS /TP) #/TP = compile as C++
|
||||
endif()
|
||||
|
|
@ -9,10 +9,10 @@ addPathRec( "${libDir}/recast/DetourCrowd/Source" )
|
|||
addPathRec( "${libDir}/recast/DetourTileCache/Source" )
|
||||
|
||||
# Additional includes
|
||||
include_directories( "${libDir}/recast/DebugUtils/Include" )
|
||||
include_directories( "${libDir}/recast/Recast/Include" )
|
||||
include_directories( "${libDir}/recast/Detour/Include" )
|
||||
include_directories( "${libDir}/recast/DetourTileCache/Include" )
|
||||
include_directories( "${libDir}/recast/DetourCrowd/Include" )
|
||||
addInclude( "${libDir}/recast/DebugUtils/Include" )
|
||||
addInclude( "${libDir}/recast/Recast/Include" )
|
||||
addInclude( "${libDir}/recast/Detour/Include" )
|
||||
addInclude( "${libDir}/recast/DetourTileCache/Include" )
|
||||
addInclude( "${libDir}/recast/DetourCrowd/Include" )
|
||||
|
||||
addStaticLib()
|
||||
finishLibrary()
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
project(squish)
|
||||
|
||||
addStaticLib("${libDir}/${PROJECT_NAME}")
|
||||
finishLibrary("${libDir}/${PROJECT_NAME}")
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
project(tinyxml)
|
||||
|
||||
addStaticLib("${libDir}/${PROJECT_NAME}")
|
||||
finishLibrary("${libDir}/${PROJECT_NAME}")
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
project(zlib)
|
||||
|
||||
addStaticLib("${libDir}/${PROJECT_NAME}")
|
||||
finishLibrary("${libDir}/${PROJECT_NAME}")
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
addPathRec( "${srcDir}/platform/input/razerHydra" )
|
||||
|
||||
# Includes
|
||||
include_directories( "${TORQUE_RAZERHYDRA_SDK_PATH}/include" )
|
||||
addInclude( "${TORQUE_RAZERHYDRA_SDK_PATH}/include" )
|
||||
|
||||
# Install
|
||||
if( WIN32 )
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
# Navigation module
|
||||
|
||||
addRequiredDefinition( "TORQUE_NAVIGATION_ENABLED" )
|
||||
addRequiredLibrary( "libraries/library_recast.cmake" )
|
||||
addRequiredLink( "recast" )
|
||||
addDef( "TORQUE_NAVIGATION_ENABLED" )
|
||||
addLib( "recast" )
|
||||
|
||||
# files
|
||||
addPathRec( "${srcDir}/navigation" )
|
||||
|
||||
# include paths
|
||||
include_directories( "${libDir}/recast/DebugUtils/Include" )
|
||||
include_directories( "${libDir}/recast/Recast/Include" )
|
||||
include_directories( "${libDir}/recast/Detour/Include" )
|
||||
include_directories( "${libDir}/recast/DetourTileCache/Include" )
|
||||
include_directories( "${libDir}/recast/DetourCrowd/Include" )
|
||||
addInclude( "${libDir}/recast/DebugUtils/Include" )
|
||||
addInclude( "${libDir}/recast/Recast/Include" )
|
||||
addInclude( "${libDir}/recast/Detour/Include" )
|
||||
addInclude( "${libDir}/recast/DetourTileCache/Include" )
|
||||
addInclude( "${libDir}/recast/DetourCrowd/Include" )
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
addPathRec( "${srcDir}/platform/input/oculusVR" )
|
||||
|
||||
# Includes
|
||||
include_directories( "${TORQUE_OCULUSVR_SDK_PATH}/LibOVR/Include" )
|
||||
include_directories( "${TORQUE_OCULUSVR_SDK_PATH}/LibOVR/Src" )
|
||||
addInclude( "${TORQUE_OCULUSVR_SDK_PATH}/LibOVR/Include" )
|
||||
addInclude( "${TORQUE_OCULUSVR_SDK_PATH}/LibOVR/Src" )
|
||||
|
||||
# Libs
|
||||
if( WIN32 )
|
||||
link_directories( "${TORQUE_OCULUSVR_SDK_PATH}/LibOVR/Lib/Win32" )
|
||||
addRequiredLink( "libovr.lib" )
|
||||
addRequiredLink( "libovrd.lib" )
|
||||
addLib( "libovr" )
|
||||
addLib( "libovrd" )
|
||||
endif()
|
||||
|
|
@ -4,14 +4,11 @@
|
|||
# 1st thing: the project name
|
||||
project(pcre)
|
||||
|
||||
# 2nd: add the paths where the source code is
|
||||
# add the paths where the source code is
|
||||
|
||||
addPath("${libDir}/pcre")
|
||||
addPathRec("${libDir}/pcre")
|
||||
|
||||
# 3rd: add addStaticLib()
|
||||
addStaticLib()
|
||||
|
||||
# then add definitions
|
||||
addDef(PCRE_STATIC)
|
||||
addDef(HAVE_CONFIG_H)
|
||||
|
|
@ -19,3 +16,6 @@ addDef(HAVE_CONFIG_H)
|
|||
# and maybe more include paths
|
||||
addInclude(${libDir}/libvorbis/include)
|
||||
addInclude(${libDir}/libogg/include)
|
||||
|
||||
# finally: add finishLibrary()
|
||||
finishLibrary()
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ project(${TORQUE_APP_NAME})
|
|||
###############################################################################
|
||||
option(TORQUE_SFX_VORBIS "Vorbis Sound" ON)
|
||||
mark_as_advanced(TORQUE_SFX_VORBIS)
|
||||
option(TORQUE_THEORA "Theora Video Support" ON)
|
||||
mark_as_advanced(TORQUE_THEORA)
|
||||
option(TORQUE_ADVANCED_LIGHTING "Advanced Lighting" ON)
|
||||
mark_as_advanced(TORQUE_ADVANCED_LIGHTING)
|
||||
option(TORQUE_BASIC_LIGHTING "Basic Lighting" ON)
|
||||
mark_as_advanced(TORQUE_BASIC_LIGHTING)
|
||||
option(TORQUE_THEORA "Theora Video Support" ON)
|
||||
mark_as_advanced(TORQUE_THEORA)
|
||||
option(TORQUE_SFX_DirectX "DirectX Sound" ON)
|
||||
mark_as_advanced(TORQUE_SFX_DirectX)
|
||||
option(TORQUE_SFX_OPENAL "OpenAL Sound" ON)
|
||||
|
|
@ -199,14 +199,17 @@ if(TORQUE_ADVANCED_LIGHTING)
|
|||
addPathRec("${srcDir}/lighting/shadowMap")
|
||||
addPathRec("${srcDir}/lighting/advanced/hlsl")
|
||||
#addPathRec("${srcDir}/lighting/advanced/glsl")
|
||||
addDef(TORQUE_ADVANCED_LIGHTING)
|
||||
endif()
|
||||
if(TORQUE_BASIC_LIGHTING)
|
||||
addPathRec("${srcDir}/lighting/basic")
|
||||
addPathRec("${srcDir}/lighting/shadowMap")
|
||||
addDef(TORQUE_BASIC_LIGHTING)
|
||||
endif()
|
||||
|
||||
# DirectX Sound
|
||||
if(TORQUE_SFX_DirectX)
|
||||
addLib(x3daudio.lib)
|
||||
addPathRec("${srcDir}/sfx/dsound")
|
||||
addPathRec("${srcDir}/sfx/xaudio")
|
||||
endif()
|
||||
|
|
@ -216,6 +219,15 @@ if(TORQUE_SFX_OPENAL)
|
|||
addPath("${srcDir}/sfx/openal")
|
||||
#addPath("${srcDir}/sfx/openal/mac")
|
||||
addPath("${srcDir}/sfx/openal/win32")
|
||||
addInclude("${libDir}/openal/win32")
|
||||
endif()
|
||||
|
||||
# Vorbis
|
||||
if(TORQUE_SFX_VORBIS)
|
||||
addInclude(${libDir}/libvorbis/include)
|
||||
addDef(TORQUE_OGGVORBIS)
|
||||
addLib(libvorbis)
|
||||
addLib(libogg)
|
||||
endif()
|
||||
|
||||
# Theora
|
||||
|
|
@ -223,6 +235,11 @@ if(TORQUE_THEORA)
|
|||
addPath("${srcDir}/core/ogg")
|
||||
addPath("${srcDir}/gfx/video")
|
||||
addPath("${srcDir}/gui/theora")
|
||||
|
||||
addDef(TORQUE_OGGTHEORA)
|
||||
addDef(TORQUE_OGGVORIBS)
|
||||
addInclude(${libDir}/libtheora/include)
|
||||
addLib(libtheora)
|
||||
endif()
|
||||
|
||||
# Include tools for non-tool builds (or define player if a tool build)
|
||||
|
|
@ -236,10 +253,12 @@ endif()
|
|||
|
||||
if(TORQUE_HIFI)
|
||||
addPath("${srcDir}/T3D/gameBase/hifi")
|
||||
addDef(TORQUE_HIFI_NET)
|
||||
endif()
|
||||
|
||||
if(TORQUE_EXTENDED_MOVE)
|
||||
addPath("${srcDir}/T3D/gameBase/extended")
|
||||
addDef(TORQUE_EXTENDED_MOVE)
|
||||
else()
|
||||
addPath("${srcDir}/T3D/gameBase/std")
|
||||
endif()
|
||||
|
|
@ -337,7 +356,7 @@ endif()
|
|||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
addExecutable()
|
||||
finishExecutable()
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -356,15 +375,15 @@ if(EXISTS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/main.cs.in" AND
|
|||
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/main.cs.in" "${projectOutDir}/main.cs")
|
||||
endif()
|
||||
if(WIN32)
|
||||
if(NOT EXISTS "${projectSrcDir}/torque.rc")
|
||||
CONFIGURE_FILE("${cmakeDir}/torque-win.rc.in" "${projectSrcDir}/torque.rc")
|
||||
endif()
|
||||
if(NOT EXISTS "${projectOutDir}/${PROJECT_NAME}-debug.bat")
|
||||
CONFIGURE_FILE("${cmakeDir}/app-debug-win.bat.in" "${projectOutDir}/${PROJECT_NAME}-debug.bat")
|
||||
endif()
|
||||
if(NOT EXISTS "${projectOutDir}/cleanup.bat")
|
||||
CONFIGURE_FILE("${cmakeDir}/cleanup-win.bat.in" "${projectOutDir}/cleanup.bat")
|
||||
endif()
|
||||
if(NOT EXISTS "${projectSrcDir}/torque.rc")
|
||||
CONFIGURE_FILE("${cmakeDir}/torque-win.rc.in" "${projectSrcDir}/torque.rc")
|
||||
endif()
|
||||
if(NOT EXISTS "${projectOutDir}/${PROJECT_NAME}-debug.bat")
|
||||
CONFIGURE_FILE("${cmakeDir}/app-debug-win.bat.in" "${projectOutDir}/${PROJECT_NAME}-debug.bat")
|
||||
endif()
|
||||
if(NOT EXISTS "${projectOutDir}/cleanup.bat")
|
||||
CONFIGURE_FILE("${cmakeDir}/cleanup-win.bat.in" "${projectOutDir}/cleanup.bat")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
|
|
@ -384,18 +403,17 @@ addLib(convexDecomp)
|
|||
|
||||
if(WIN32)
|
||||
# copy pasted from T3D build system, some might not be needed
|
||||
set(TORQUE_EXTERNAL_LIBS "COMCTL32.LIB;COMDLG32.LIB;USER32.LIB;ADVAPI32.LIB;GDI32.LIB;WINMM.LIB;WSOCK32.LIB;vfw32.lib;Imm32.lib;d3d9.lib;d3dx9.lib;DxErr.lib;ole32.lib;shell32.lib;oleaut32.lib;version.lib" CACHE STRING "external libs to link against")
|
||||
mark_as_advanced(TORQUE_EXTERNAL_LIBS)
|
||||
set(TORQUE_EXTERNAL_LIBS "COMCTL32.LIB;COMDLG32.LIB;USER32.LIB;ADVAPI32.LIB;GDI32.LIB;WINMM.LIB;WSOCK32.LIB;vfw32.lib;Imm32.lib;d3d9.lib;d3dx9.lib;DxErr.lib;ole32.lib;shell32.lib;oleaut32.lib;version.lib" CACHE STRING "external libs to link against")
|
||||
mark_as_advanced(TORQUE_EXTERNAL_LIBS)
|
||||
addLib("${TORQUE_EXTERNAL_LIBS}")
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
# Always enabled Definitions
|
||||
###############################################################################
|
||||
addDebugDef(TORQUE_DEBUG)
|
||||
addDebugDef(TORQUE_ENABLE_ASSERTS)
|
||||
addDebugDef(TORQUE_DEBUG_GFX_MODE)
|
||||
|
||||
addDef(TORQUE_DEBUG DEBUG)
|
||||
addDef(TORQUE_ENABLE_ASSERTS "DEBUG;RelWithDebInfo")
|
||||
addDef(TORQUE_DEBUG_GFX_MODE "RelWithDebInfo")
|
||||
addDef(TORQUE_SHADERGEN)
|
||||
addDef(INITGUID)
|
||||
addDef(NTORQUE_SHARED)
|
||||
|
|
@ -413,46 +431,6 @@ addDef(PCRE_STATIC)
|
|||
addDef(_CRT_SECURE_NO_WARNINGS)
|
||||
addDef(_CRT_SECURE_NO_DEPRECATE)
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Modules
|
||||
###############################################################################
|
||||
if(TORQUE_SFX_DirectX)
|
||||
addLib(x3daudio.lib)
|
||||
endif()
|
||||
|
||||
if(TORQUE_ADVANCED_LIGHTING)
|
||||
addDef(TORQUE_ADVANCED_LIGHTING)
|
||||
endif()
|
||||
if(TORQUE_BASIC_LIGHTING)
|
||||
addDef(TORQUE_BASIC_LIGHTING)
|
||||
endif()
|
||||
|
||||
if(TORQUE_SFX_OPENAL)
|
||||
addInclude("${libDir}/openal/win32")
|
||||
endif()
|
||||
|
||||
if(TORQUE_SFX_VORBIS)
|
||||
addInclude(${libDir}/libvorbis/include)
|
||||
addDef(TORQUE_OGGVORBIS)
|
||||
addLib(libvorbis)
|
||||
addLib(libogg)
|
||||
endif()
|
||||
|
||||
if(TORQUE_THEORA)
|
||||
addDef(TORQUE_OGGTHEORA)
|
||||
addDef(TORQUE_OGGVORIBS)
|
||||
addInclude(${libDir}/libtheora/include)
|
||||
addLib(libtheora)
|
||||
endif()
|
||||
|
||||
if(TORQUE_HIFI)
|
||||
addDef(TORQUE_HIFI_NET)
|
||||
endif()
|
||||
if(TORQUE_EXTENDED_MOVE)
|
||||
addDef(TORQUE_EXTENDED_MOVE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
# Include Paths
|
||||
###############################################################################
|
||||
|
|
|
|||
Loading…
Reference in a new issue