-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists.txt
104 lines (85 loc) · 3.68 KB
/
CMakeLists.txt
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
CMAKE_MINIMUM_REQUIRED(VERSION 3.16.0)
IF(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
MESSAGE(STATUS "Using vcpkg env variable")
SET(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
ELSEIF(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
MESSAGE(STATUS "Using vcpkg submodule")
SET(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/submodules/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
ENDIF()
OPTION(EQEMU_ENABLE_GL "Enable programs that rely on OpenGL (turn off if you only want command line)" ON)
IF(EQEMU_ENABLE_GL)
LIST(APPEND VCPKG_MANIFEST_FEATURES "graphics")
ENDIF(EQEMU_ENABLE_GL)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_CXX_EXTENSIONS OFF)
PROJECT(EQEmuZoneUtils)
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
SET(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external" "${CMAKE_PREFIX_PATH}")
IF(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF(MSVC)
OPTION(EQEMU_ENABLE_LOG_TRACE "Enable trace logging" OFF)
OPTION(EQEMU_ENABLE_LOG_DEBUG "Enable debug logging" OFF)
OPTION(EQEMU_ENABLE_LOG_INFO "Enable info logging" ON)
OPTION(EQEMU_ENABLE_LOG_WARN "Enable warning logging" ON)
OPTION(EQEMU_ENABLE_LOG_ERROR "Enable error logging" ON)
OPTION(EQEMU_ENABLE_LOG_FATAL "Enable fatal error logging" ON)
SET(EQEMU_LOG_LEVEL 0)
IF(EQEMU_ENABLE_LOG_TRACE)
MATH(EXPR EQEMU_LOG_LEVEL "${EQEMU_LOG_LEVEL} + 1")
ENDIF(EQEMU_ENABLE_LOG_TRACE)
IF(EQEMU_ENABLE_LOG_DEBUG)
MATH(EXPR EQEMU_LOG_LEVEL "${EQEMU_LOG_LEVEL} + 2")
ENDIF(EQEMU_ENABLE_LOG_DEBUG)
IF(EQEMU_ENABLE_LOG_INFO)
MATH(EXPR EQEMU_LOG_LEVEL "${EQEMU_LOG_LEVEL} + 4")
ENDIF(EQEMU_ENABLE_LOG_INFO)
IF(EQEMU_ENABLE_LOG_WARN)
MATH(EXPR EQEMU_LOG_LEVEL "${EQEMU_LOG_LEVEL} + 8")
ENDIF(EQEMU_ENABLE_LOG_WARN)
IF(EQEMU_ENABLE_LOG_ERROR)
MATH(EXPR EQEMU_LOG_LEVEL "${EQEMU_LOG_LEVEL} + 16")
ENDIF(EQEMU_ENABLE_LOG_ERROR)
IF(EQEMU_ENABLE_LOG_FATAL)
MATH(EXPR EQEMU_LOG_LEVEL "${EQEMU_LOG_LEVEL} + 32")
ENDIF(EQEMU_ENABLE_LOG_FATAL)
ADD_DEFINITIONS(-DEQEMU_LOG_LEVEL=${EQEMU_LOG_LEVEL})
FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(Bullet CONFIG REQUIRED)
FIND_PACKAGE(glm CONFIG REQUIRED)
FIND_PACKAGE(libuv CONFIG REQUIRED)
ADD_DEFINITIONS(-DGLM_FORCE_CTOR_INIT)
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/src/common/")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/src/log/")
IF(EQEMU_ENABLE_GL)
FIND_PACKAGE(glfw3 CONFIG REQUIRED)
FIND_PACKAGE(GLEW REQUIRED)
FIND_PACKAGE(OpenGL REQUIRED)
FIND_PACKAGE(imgui CONFIG REQUIRED)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/dependencies/recastnavigation/Recast/Include")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/dependencies/recastnavigation/DetourTileCache/Include")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/dependencies/recastnavigation/Detour/Include")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/dependencies/recastnavigation/DebugUtils/Include")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/dependencies/recastnavigation/DetourCrowd/Include")
ADD_SUBDIRECTORY(dependencies/recastnavigation)
ADD_SUBDIRECTORY(src/common)
ADD_SUBDIRECTORY(src/log)
ADD_SUBDIRECTORY(src/azone)
ADD_SUBDIRECTORY(src/awater)
ADD_SUBDIRECTORY(src/pfs)
ADD_SUBDIRECTORY(src/map_edit)
ADD_SUBDIRECTORY(src/model_view)
ELSE(EQEMU_ENABLE_GL)
ADD_SUBDIRECTORY(src/common)
ADD_SUBDIRECTORY(src/log)
ADD_SUBDIRECTORY(src/azone)
ADD_SUBDIRECTORY(src/awater)
ADD_SUBDIRECTORY(src/pfs)
ENDIF(EQEMU_ENABLE_GL)