Modularize CMakeLists for submodules (#736)

* Use RecastNavigation CMakeLists

* Use tinyxml2 CMakeLists

* Use bcrypt CMakeLists

* Move variable init to CMakeLists

This has to be done here to prevent missing dependency errors.

* General improvements

Only link dynamic if on gnu
use more thirdparty cmakes

* Disable tinyxml2 testing
This commit is contained in:
David Markowitz
2022-08-18 19:23:42 -07:00
committed by GitHub
parent f8c1e2fb52
commit c05562a227
8 changed files with 40 additions and 56 deletions

View File

@@ -42,6 +42,12 @@ set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT
# Echo the version
message(STATUS "Version: ${PROJECT_VERSION}")
# Disable demo, tests and examples for recastNavigation. Turn these to ON if you want to use them
# This has to be done here to prevent a rare build error due to missing dependencies on the initial generations.
set(RECASTNAVIGATION_DEMO OFF CACHE BOOL "" FORCE)
set(RECASTNAVIGATION_TESTS OFF CACHE BOOL "" FORCE)
set(RECASTNAVIGATION_EXAMPLES OFF CACHE BOOL "" FORCE)
# Compiler flags:
# Disabled deprecated warnings as the MySQL includes have deprecated code in them.
# Disabled misleading indentation as DL_LinkedList from RakNet has a weird indent.
@@ -54,7 +60,7 @@ if(UNIX)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17 -O2 -Wuninitialized -D_GLIBCXX_USE_CXX11_ABI=0 -D_GLIBCXX_USE_CXX17_ABI=0 -static-libgcc -fPIC")
endif()
if (__dynamic)
if (__dynamic AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic")
endif()
if (__ggdb)
@@ -137,8 +143,7 @@ set(INCLUDED_DIRECTORIES
"thirdparty/raknet/Source"
"thirdparty/tinyxml2"
"thirdparty/recastnavigation/Recast/Include"
"thirdparty/recastnavigation/Detour/Include"
"thirdparty/recastnavigation"
"thirdparty/SQLite"
"thirdparty/cpplinq"
)