-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
52 lines (44 loc) · 1.77 KB
/
CMakeLists.txt
File metadata and controls
52 lines (44 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
cmake_minimum_required(VERSION 3.15)
project(cronus VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
# Set PIC globally for all targets (required for linking static libs into shared libs)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Include FetchContent module for external dependencies
include(FetchContent)
# Disable automatic updates of fetched content if already present
set(FETCHCONTENT_UPDATES_DISCONNECTED ON)
# Check if arbiterAI already exists, if so add it directly
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/server/arbiterAI/CMakeLists.txt)
message(STATUS "Using existing arbiterAI from server/arbiterAI")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/server/arbiterAI)
else()
# Fetch arbiterAI library
FetchContent_Declare(
arbiterAI
GIT_REPOSITORY https://github.com/caseymcc/arbiterAI
GIT_TAG main
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/server/arbiterAI
)
FetchContent_MakeAvailable(arbiterAI)
endif()
# Check if loreforge already exists, if so add it directly
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/server/loreforge/CMakeLists.txt)
message(STATUS "Using existing loreforge from server/loreforge")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/server/loreforge)
else()
# Fetch loreforge library (which also depends on arbiterAI)
FetchContent_Declare(
loreforge
GIT_REPOSITORY https://github.com/caseymcc/loreforge
GIT_TAG main
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/server/loreforge
)
FetchContent_MakeAvailable(loreforge)
endif()
# Add the cronus server
add_subdirectory(server/cronus)
add_subdirectory(clients/cli)
#add_subdirectory(web)