2022-11-03 03:30:35 +00:00
|
|
|
cmake_minimum_required(VERSION 3.18)
|
2021-12-05 17:54:36 +00:00
|
|
|
project(Darkflame)
|
2022-01-03 15:00:21 +00:00
|
|
|
include(CTest)
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-01-02 07:53:00 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
2024-01-30 03:45:50 +00:00
|
|
|
set(CXX_STANDARD_REQUIRED ON)
|
2024-01-03 00:25:57 +00:00
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
2022-07-10 19:40:26 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
# Read variables from file
|
|
|
|
FILE(READ "${CMAKE_SOURCE_DIR}/CMakeVariables.txt" variables)
|
|
|
|
|
|
|
|
string(REPLACE "\\\n" "" variables ${variables})
|
|
|
|
string(REPLACE "\n" ";" variables ${variables})
|
|
|
|
|
|
|
|
# Set the cmake variables, formatted as "VARIABLE #" in variables
|
|
|
|
foreach(variable ${variables})
|
2022-07-16 23:24:16 +00:00
|
|
|
# If the string contains a #, skip it
|
|
|
|
if(NOT "${variable}" MATCHES "#")
|
2022-07-18 09:01:43 +00:00
|
|
|
# Split the variable into name and value
|
2022-07-16 23:24:16 +00:00
|
|
|
string(REPLACE "=" ";" variable ${variable})
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-18 09:01:43 +00:00
|
|
|
# Check that the length of the variable is 2 (name and value)
|
2022-07-16 23:24:16 +00:00
|
|
|
list(LENGTH variable length)
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-01-03 00:25:57 +00:00
|
|
|
if(${length} EQUAL 2)
|
2022-07-16 23:24:16 +00:00
|
|
|
list(GET variable 0 variable_name)
|
|
|
|
list(GET variable 1 variable_value)
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
# Set the variable
|
|
|
|
set(${variable_name} ${variable_value})
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
message(STATUS "Variable: ${variable_name} = ${variable_value}")
|
2022-07-04 08:30:11 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
2021-12-05 17:54:36 +00:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# Set the version
|
2023-12-31 06:26:49 +00:00
|
|
|
set(PROJECT_VERSION "\"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}\"")
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
# Echo the version
|
|
|
|
message(STATUS "Version: ${PROJECT_VERSION}")
|
|
|
|
|
2022-08-19 02:23:42 +00:00
|
|
|
# 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)
|
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
# Compiler flags:
|
2022-08-02 05:30:19 +00:00
|
|
|
# Disabled deprecated warnings as the MySQL includes have deprecated code in them.
|
2022-07-16 23:24:16 +00:00
|
|
|
# Disabled misleading indentation as DL_LinkedList from RakNet has a weird indent.
|
|
|
|
# Disabled no-register
|
|
|
|
# Disabled unknown pragmas because Linux doesn't understand Windows pragmas.
|
|
|
|
if(UNIX)
|
2024-01-08 23:32:09 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wuninitialized -fPIC")
|
2023-12-31 06:26:49 +00:00
|
|
|
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0 _GLIBCXX_USE_CXX17_ABI=0)
|
2024-01-03 00:25:57 +00:00
|
|
|
|
2023-12-31 06:26:49 +00:00
|
|
|
if(NOT APPLE)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -lstdc++fs")
|
2022-07-16 23:24:16 +00:00
|
|
|
endif()
|
2023-12-31 06:26:49 +00:00
|
|
|
|
2024-01-03 00:25:57 +00:00
|
|
|
if(${DYNAMIC} AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
2022-07-16 23:24:16 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic")
|
|
|
|
endif()
|
2023-12-31 06:26:49 +00:00
|
|
|
|
2024-01-03 00:25:57 +00:00
|
|
|
if(${GGDB})
|
2022-07-16 23:24:16 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
|
|
|
|
endif()
|
2023-12-31 06:26:49 +00:00
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC")
|
|
|
|
elseif(MSVC)
|
|
|
|
# Skip warning for invalid conversion from size_t to uint32_t for all targets below for now
|
2022-07-20 08:23:53 +00:00
|
|
|
add_compile_options("/wd4267" "/utf-8")
|
2022-07-16 23:24:16 +00:00
|
|
|
elseif(WIN32)
|
|
|
|
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
|
|
|
endif()
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
# Our output dir
|
|
|
|
set(CMAKE_BINARY_DIR ${PROJECT_BINARY_DIR})
|
2022-11-07 08:12:35 +00:00
|
|
|
|
|
|
|
# TODO make this not have to override the build type directories
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR})
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR})
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR})
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
|
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-12-22 06:34:11 +00:00
|
|
|
# Create a /resServer directory
|
|
|
|
make_directory(${CMAKE_BINARY_DIR}/resServer)
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2021-12-13 15:57:43 +00:00
|
|
|
# Create a /logs directory
|
|
|
|
make_directory(${CMAKE_BINARY_DIR}/logs)
|
|
|
|
|
2022-07-18 09:01:43 +00:00
|
|
|
# Copy resource files on first build
|
2022-10-29 23:17:35 +00:00
|
|
|
set(RESOURCE_FILES "sharedconfig.ini" "authconfig.ini" "chatconfig.ini" "worldconfig.ini" "masterconfig.ini" "blacklist.dcf")
|
2023-07-23 19:09:07 +00:00
|
|
|
message(STATUS "Checking resource file integrity")
|
2024-01-03 00:25:57 +00:00
|
|
|
|
|
|
|
include(Utils)
|
2024-01-03 08:36:17 +00:00
|
|
|
UpdateConfigOption(${PROJECT_BINARY_DIR}/authconfig.ini "port" "auth_server_port")
|
|
|
|
UpdateConfigOption(${PROJECT_BINARY_DIR}/chatconfig.ini "port" "chat_server_port")
|
|
|
|
UpdateConfigOption(${PROJECT_BINARY_DIR}/masterconfig.ini "port" "master_server_port")
|
2024-01-03 00:25:57 +00:00
|
|
|
|
|
|
|
foreach(resource_file ${RESOURCE_FILES})
|
2023-07-23 19:09:07 +00:00
|
|
|
set(file_size 0)
|
2024-01-03 00:25:57 +00:00
|
|
|
|
|
|
|
if(EXISTS ${PROJECT_BINARY_DIR}/${resource_file})
|
2023-07-23 19:09:07 +00:00
|
|
|
file(SIZE ${PROJECT_BINARY_DIR}/${resource_file} file_size)
|
|
|
|
endif()
|
2024-01-03 00:25:57 +00:00
|
|
|
|
|
|
|
if(${file_size} EQUAL 0)
|
2022-07-16 23:24:16 +00:00
|
|
|
configure_file(
|
2022-07-17 06:54:36 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/resources/${resource_file} ${PROJECT_BINARY_DIR}/${resource_file}
|
2022-07-16 23:24:16 +00:00
|
|
|
COPYONLY
|
|
|
|
)
|
2023-07-23 19:09:07 +00:00
|
|
|
message(STATUS "Moved " ${resource_file} " to project binary directory")
|
2024-01-03 00:25:57 +00:00
|
|
|
elseif(resource_file MATCHES ".ini")
|
2023-07-23 19:09:07 +00:00
|
|
|
message(STATUS "Checking " ${resource_file} " for missing config options")
|
|
|
|
file(READ ${PROJECT_BINARY_DIR}/${resource_file} current_file_contents)
|
|
|
|
string(REPLACE "\\\n" "" current_file_contents ${current_file_contents})
|
|
|
|
string(REPLACE "\n" ";" current_file_contents ${current_file_contents})
|
|
|
|
set(parsed_current_file_contents "")
|
2024-01-03 00:25:57 +00:00
|
|
|
|
2023-07-23 19:09:07 +00:00
|
|
|
# Remove comment lines so they do not interfere with the variable parsing
|
2024-01-03 00:25:57 +00:00
|
|
|
foreach(line ${current_file_contents})
|
2023-07-23 19:09:07 +00:00
|
|
|
string(FIND ${line} "#" is_comment)
|
2024-01-03 00:25:57 +00:00
|
|
|
|
|
|
|
if(NOT ${is_comment} EQUAL 0)
|
2023-07-23 19:09:07 +00:00
|
|
|
string(APPEND parsed_current_file_contents ${line})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2024-01-03 00:25:57 +00:00
|
|
|
|
2023-07-23 19:09:07 +00:00
|
|
|
file(READ ${CMAKE_SOURCE_DIR}/resources/${resource_file} depot_file_contents)
|
|
|
|
string(REPLACE "\\\n" "" depot_file_contents ${depot_file_contents})
|
|
|
|
string(REPLACE "\n" ";" depot_file_contents ${depot_file_contents})
|
|
|
|
set(line_to_add "")
|
2024-01-03 00:25:57 +00:00
|
|
|
|
|
|
|
foreach(line ${depot_file_contents})
|
2023-07-23 19:09:07 +00:00
|
|
|
string(FIND ${line} "#" is_comment)
|
2024-01-03 00:25:57 +00:00
|
|
|
|
|
|
|
if(NOT ${is_comment} EQUAL 0)
|
2023-07-23 19:09:07 +00:00
|
|
|
string(REPLACE "=" ";" line_split ${line})
|
|
|
|
list(GET line_split 0 variable_name)
|
2024-01-03 00:25:57 +00:00
|
|
|
|
|
|
|
if(NOT ${parsed_current_file_contents} MATCHES ${variable_name})
|
2023-07-23 19:09:07 +00:00
|
|
|
message(STATUS "Adding missing config option " ${variable_name} " to " ${resource_file})
|
|
|
|
set(line_to_add ${line_to_add} ${line})
|
2024-01-03 00:25:57 +00:00
|
|
|
|
|
|
|
foreach(line_to_append ${line_to_add})
|
2023-07-23 19:09:07 +00:00
|
|
|
file(APPEND ${PROJECT_BINARY_DIR}/${resource_file} "\n" ${line_to_append})
|
|
|
|
endforeach()
|
2024-01-03 00:25:57 +00:00
|
|
|
|
2023-07-23 19:09:07 +00:00
|
|
|
file(APPEND ${PROJECT_BINARY_DIR}/${resource_file} "\n")
|
|
|
|
endif()
|
2024-01-03 00:25:57 +00:00
|
|
|
|
2023-07-23 19:09:07 +00:00
|
|
|
set(line_to_add "")
|
|
|
|
else()
|
|
|
|
set(line_to_add ${line_to_add} ${line})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2022-07-16 23:24:16 +00:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2024-01-03 00:25:57 +00:00
|
|
|
|
2023-07-23 19:09:07 +00:00
|
|
|
message(STATUS "Resource file integrity check complete")
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-10-28 04:19:43 +00:00
|
|
|
# if navmeshes directory does not exist, create it
|
2024-01-03 00:25:57 +00:00
|
|
|
if(NOT EXISTS ${PROJECT_BINARY_DIR}/navmeshes)
|
2023-10-28 04:19:43 +00:00
|
|
|
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/navmeshes)
|
2022-11-01 18:21:26 +00:00
|
|
|
endif()
|
|
|
|
|
2023-10-28 04:19:43 +00:00
|
|
|
# Copy navmesh data on first build and extract it
|
2023-12-31 06:26:49 +00:00
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/resources/navmeshes.zip ${PROJECT_BINARY_DIR}/navmeshes.zip COPYONLY)
|
2023-10-28 04:19:43 +00:00
|
|
|
|
|
|
|
file(ARCHIVE_EXTRACT INPUT ${PROJECT_BINARY_DIR}/navmeshes.zip DESTINATION ${PROJECT_BINARY_DIR}/navmeshes)
|
|
|
|
file(REMOVE ${PROJECT_BINARY_DIR}/navmeshes.zip)
|
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
# Copy vanity files on first build
|
|
|
|
set(VANITY_FILES "CREDITS.md" "INFO.md" "TESTAMENT.md" "NPC.xml")
|
2024-01-03 00:25:57 +00:00
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
foreach(file ${VANITY_FILES})
|
|
|
|
configure_file("${CMAKE_SOURCE_DIR}/vanity/${file}" "${CMAKE_BINARY_DIR}/vanity/${file}" COPYONLY)
|
|
|
|
endforeach()
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-10 19:40:26 +00:00
|
|
|
# Move our migrations for MasterServer to run
|
2022-10-30 07:38:43 +00:00
|
|
|
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/migrations/dlu/)
|
2022-07-10 19:40:26 +00:00
|
|
|
file(GLOB SQL_FILES ${CMAKE_SOURCE_DIR}/migrations/dlu/*.sql)
|
2024-01-03 00:25:57 +00:00
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
foreach(file ${SQL_FILES})
|
|
|
|
get_filename_component(file ${file} NAME)
|
2023-12-31 06:26:49 +00:00
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/migrations/dlu/${file} ${PROJECT_BINARY_DIR}/migrations/dlu/${file})
|
2022-10-30 07:38:43 +00:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/migrations/cdserver/)
|
|
|
|
file(GLOB SQL_FILES ${CMAKE_SOURCE_DIR}/migrations/cdserver/*.sql)
|
2024-01-03 00:25:57 +00:00
|
|
|
|
2022-10-30 07:38:43 +00:00
|
|
|
foreach(file ${SQL_FILES})
|
|
|
|
get_filename_component(file ${file} NAME)
|
2023-12-31 06:26:49 +00:00
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/migrations/cdserver/${file} ${PROJECT_BINARY_DIR}/migrations/cdserver/${file})
|
2022-07-10 19:40:26 +00:00
|
|
|
endforeach()
|
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
# Create our list of include directories
|
|
|
|
set(INCLUDED_DIRECTORIES
|
|
|
|
"dCommon"
|
2022-11-26 22:22:00 +00:00
|
|
|
"dCommon/dClient"
|
|
|
|
"dCommon/dEnums"
|
2023-12-31 06:26:49 +00:00
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
"dChatFilter"
|
2023-12-31 06:26:49 +00:00
|
|
|
|
2022-08-02 05:30:19 +00:00
|
|
|
"dGame"
|
|
|
|
"dGame/dBehaviors"
|
|
|
|
"dGame/dComponents"
|
|
|
|
"dGame/dGameMessages"
|
|
|
|
"dGame/dInventory"
|
|
|
|
"dGame/dMission"
|
|
|
|
"dGame/dEntity"
|
2022-10-31 22:32:07 +00:00
|
|
|
"dGame/dPropertyBehaviors"
|
2023-02-14 02:55:44 +00:00
|
|
|
"dGame/dPropertyBehaviors/ControlBehaviorMessages"
|
2022-08-02 05:30:19 +00:00
|
|
|
"dGame/dUtilities"
|
2023-12-31 06:26:49 +00:00
|
|
|
|
2022-08-02 05:30:19 +00:00
|
|
|
"dPhysics"
|
2023-12-31 06:26:49 +00:00
|
|
|
|
2022-08-02 05:30:19 +00:00
|
|
|
"dNavigation"
|
2022-08-04 00:59:47 +00:00
|
|
|
"dNavigation/dTerrain"
|
2023-12-31 06:26:49 +00:00
|
|
|
|
2022-08-02 05:30:19 +00:00
|
|
|
"dZoneManager"
|
2023-12-31 06:26:49 +00:00
|
|
|
|
2022-08-02 05:30:19 +00:00
|
|
|
"dDatabase"
|
2023-11-18 00:47:18 +00:00
|
|
|
"dDatabase/CDClientDatabase"
|
|
|
|
"dDatabase/CDClientDatabase/CDClientTables"
|
|
|
|
"dDatabase/GameDatabase"
|
|
|
|
"dDatabase/GameDatabase/ITables"
|
|
|
|
"dDatabase/GameDatabase/MySQL"
|
|
|
|
"dDatabase/GameDatabase/MySQL/Tables"
|
2023-12-31 06:26:49 +00:00
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
"dNet"
|
2023-12-31 06:26:49 +00:00
|
|
|
|
2023-12-23 16:51:59 +00:00
|
|
|
"thirdparty/magic_enum/include/magic_enum"
|
2022-07-16 23:24:16 +00:00
|
|
|
"thirdparty/raknet/Source"
|
|
|
|
"thirdparty/tinyxml2"
|
2022-08-19 02:23:42 +00:00
|
|
|
"thirdparty/recastnavigation"
|
2022-07-16 23:24:16 +00:00
|
|
|
"thirdparty/SQLite"
|
|
|
|
"thirdparty/cpplinq"
|
2024-01-05 12:33:52 +00:00
|
|
|
"thirdparty/cpp-httplib"
|
2024-02-09 15:15:28 +00:00
|
|
|
"thirdparty/MD5"
|
2022-11-07 08:12:35 +00:00
|
|
|
|
|
|
|
"tests"
|
|
|
|
"tests/dCommonTests"
|
|
|
|
"tests/dGameTests"
|
|
|
|
"tests/dGameTests/dComponentsTests"
|
2023-12-31 06:26:49 +00:00
|
|
|
)
|
2022-07-16 23:24:16 +00:00
|
|
|
|
|
|
|
# Add system specfic includes for Apple, Windows and Other Unix OS' (including Linux)
|
2024-01-03 00:25:57 +00:00
|
|
|
if(APPLE)
|
2022-07-16 23:24:16 +00:00
|
|
|
include_directories("/usr/local/include/")
|
|
|
|
endif()
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
# Actually include the directories from our list
|
2024-01-03 00:25:57 +00:00
|
|
|
foreach(dir ${INCLUDED_DIRECTORIES})
|
2022-07-16 23:24:16 +00:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/${dir})
|
|
|
|
endforeach()
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-01-03 00:25:57 +00:00
|
|
|
if(NOT WIN32)
|
2023-12-31 06:26:49 +00:00
|
|
|
include_directories("${PROJECT_SOURCE_DIR}/thirdparty/libbcrypt/include/bcrypt")
|
|
|
|
endif()
|
|
|
|
|
2024-01-03 00:25:57 +00:00
|
|
|
include_directories("${PROJECT_SOURCE_DIR}/thirdparty/libbcrypt/include")
|
2023-12-31 06:26:49 +00:00
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
# Add linking directories:
|
|
|
|
link_directories(${PROJECT_BINARY_DIR})
|
2022-07-04 22:24:45 +00:00
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
# Load all of our third party directories
|
|
|
|
add_subdirectory(thirdparty)
|
2024-01-19 16:18:36 +00:00
|
|
|
if (UNIX)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
|
|
|
endif()
|
2022-07-16 23:24:16 +00:00
|
|
|
# Glob together all headers that need to be precompiled
|
2022-07-04 22:24:45 +00:00
|
|
|
file(
|
2022-07-16 23:24:16 +00:00
|
|
|
GLOB HEADERS_DDATABASE
|
|
|
|
LIST_DIRECTORIES false
|
2023-11-18 00:47:18 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/*.h
|
|
|
|
${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/CDClientTables/*.h
|
|
|
|
${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase/ITables/*.h
|
2022-07-16 23:24:16 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/thirdparty/SQLite/*.h
|
2022-07-04 22:24:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
file(
|
2022-07-16 23:24:16 +00:00
|
|
|
GLOB HEADERS_DZONEMANAGER
|
|
|
|
LIST_DIRECTORIES false
|
|
|
|
${PROJECT_SOURCE_DIR}/dZoneManager/*.h
|
2022-07-04 22:24:45 +00:00
|
|
|
)
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
file(
|
2022-07-16 23:24:16 +00:00
|
|
|
GLOB HEADERS_DCOMMON
|
|
|
|
LIST_DIRECTORIES false
|
|
|
|
${PROJECT_SOURCE_DIR}/dCommon/*.h
|
2021-12-05 17:54:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
file(
|
2022-07-16 23:24:16 +00:00
|
|
|
GLOB HEADERS_DGAME
|
|
|
|
LIST_DIRECTORIES false
|
2022-08-02 05:30:19 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/dGame/Entity.h
|
2022-07-16 23:24:16 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/dGame/dGameMessages/GameMessages.h
|
|
|
|
${PROJECT_SOURCE_DIR}/dGame/EntityManager.h
|
|
|
|
${PROJECT_SOURCE_DIR}/dScripts/CppScripts.h
|
|
|
|
)
|
|
|
|
|
|
|
|
# Add our library subdirectories for creation of the library object
|
|
|
|
add_subdirectory(dCommon)
|
|
|
|
add_subdirectory(dDatabase)
|
|
|
|
add_subdirectory(dChatFilter)
|
|
|
|
add_subdirectory(dNet)
|
|
|
|
add_subdirectory(dScripts) # Add for dGame to use
|
|
|
|
add_subdirectory(dGame)
|
|
|
|
add_subdirectory(dZoneManager)
|
2022-08-02 05:30:19 +00:00
|
|
|
add_subdirectory(dNavigation)
|
2022-07-16 23:24:16 +00:00
|
|
|
add_subdirectory(dPhysics)
|
2024-01-06 05:32:09 +00:00
|
|
|
add_subdirectory(dServer)
|
2022-07-16 23:24:16 +00:00
|
|
|
|
|
|
|
# Create a list of common libraries shared between all binaries
|
2024-02-09 15:15:28 +00:00
|
|
|
set(COMMON_LIBRARIES "dCommon" "dDatabase" "dNet" "raknet" "mariadbConnCpp" "magic_enum" "MD5")
|
2022-07-16 23:24:16 +00:00
|
|
|
|
|
|
|
# Add platform specific common libraries
|
2024-01-03 00:25:57 +00:00
|
|
|
if(UNIX)
|
2022-07-16 23:24:16 +00:00
|
|
|
set(COMMON_LIBRARIES ${COMMON_LIBRARIES} "dl" "pthread")
|
|
|
|
|
2024-01-03 00:25:57 +00:00
|
|
|
if(NOT APPLE AND ${INCLUDE_BACKTRACE})
|
2022-07-16 23:24:16 +00:00
|
|
|
set(COMMON_LIBRARIES ${COMMON_LIBRARIES} "backtrace")
|
|
|
|
endif()
|
|
|
|
endif()
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-16 23:24:16 +00:00
|
|
|
# Include all of our binary directories
|
|
|
|
add_subdirectory(dWorldServer)
|
|
|
|
add_subdirectory(dAuthServer)
|
|
|
|
add_subdirectory(dChatServer)
|
|
|
|
add_subdirectory(dMasterServer) # Add MasterServer last so it can rely on the other binaries
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-04 22:24:45 +00:00
|
|
|
target_precompile_headers(
|
2022-08-02 05:30:19 +00:00
|
|
|
dZoneManager PRIVATE
|
2022-07-16 23:24:16 +00:00
|
|
|
${HEADERS_DZONEMANAGER}
|
2022-07-04 22:24:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Need to specify to use the CXX compiler language here or else we get errors including <string>.
|
|
|
|
target_precompile_headers(
|
2022-08-02 05:30:19 +00:00
|
|
|
dDatabase PRIVATE
|
2022-07-16 23:24:16 +00:00
|
|
|
"$<$<COMPILE_LANGUAGE:CXX>:${HEADERS_DDATABASE}>"
|
2022-07-04 22:24:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_precompile_headers(
|
2022-07-16 23:24:16 +00:00
|
|
|
dCommon PRIVATE
|
|
|
|
${HEADERS_DCOMMON}
|
2022-07-04 22:24:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_precompile_headers(
|
2022-07-16 23:24:16 +00:00
|
|
|
tinyxml2 PRIVATE
|
|
|
|
"$<$<COMPILE_LANGUAGE:CXX>:${PROJECT_SOURCE_DIR}/thirdparty/tinyxml2/tinyxml2.h>"
|
2022-08-02 05:30:19 +00:00
|
|
|
)
|
2022-11-07 08:12:35 +00:00
|
|
|
|
2024-01-03 00:25:57 +00:00
|
|
|
if(${ENABLE_TESTING})
|
2022-11-07 08:12:35 +00:00
|
|
|
add_subdirectory(tests)
|
|
|
|
endif()
|