-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
127 lines (102 loc) · 3.83 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#-----------------------------------------------------------------------------
#
# Ryzom Core
# Authors: Nevrax and the Ryzom Core Community
# Version: 1.0.0
#
# Notes:
# * Changing install location: add -DCMAKE_INSTALL_PREFIX:PATH=/my/new/path
# * Changing specific install location variables:
# * NL_ETC_PREFIX (default: $CMAKE_INSTALL_PREFIX/etc)
# * NL_SHARE_PREFIX (default: $CMAKE_INSTALL_PREFIX/share)
# * NL_BIN_PREFIX (default: $CMAKE_INSTALL_PREFIX/bin)
# * NL_SBIN_PREFIX (default: $CMAKE_INSTALL_PREFIX/sbin)
# * NL_LIB_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib)
# * NL_DRIVER_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib (windows) or $CMAKE_INSTALL_PREFIX/lib/nel)
# * Enable building of documentation: add -DBUILD_DOCUMENTATION:BOOL=ON - new make target: DoxygenDoc
# * Updating version: update header (above) but also update NL_VERSION below.
# * To build binary archive, use the 'package' target.
# To build source archive, use the 'package_source' target.
#-----------------------------------------------------------------------------
# Load some macros.
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
#-----------------------------------------------------------------------------
# Set CMake 2.6 Policies.
IF(COMMAND cmake_policy)
# Works around warnings libraries linked against that don't
# have absolute paths (e.g. -lpthread)
cmake_policy(SET CMP0003 NEW)
ENDIF()
INCLUDE(nel)
INCLUDE(ConfigureChecks)
INCLUDE(CheckDepends)
INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
# Force out of source builds.
CHECK_OUT_OF_SOURCE()
# To be able to specify a different deployment target on Mac OS X :
# export MACOSX_DEPLOYMENT_TARGET=10.6
IF(CMAKE_VERSION VERSION_GREATER "2.8.10")
STRING(TIMESTAMP CURRENT_YEAR "%Y")
ELSE()
SET(CURRENT_YEAR "2016")
ENDIF()
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(RyzomCore CXX C)
SET(NL_VERSION_MAJOR 1)
SET(NL_VERSION_MINOR 0)
SET(NL_VERSION_PATCH 0)
SET(YEAR "2004-${CURRENT_YEAR}")
SET(AUTHOR "Winch Gate and The Ryzom Core Community")
SET(RYZOM_VERSION_MAJOR 3)
SET(RYZOM_VERSION_MINOR 3)
SET(RYZOM_VERSION_PATCH 0)
#-----------------------------------------------------------------------------
# Redirect output files
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# DLL should be in the same directory as EXE under Windows
IF(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
ELSE()
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
ENDIF()
#-----------------------------------------------------------------------------
# Set default config options
#
NL_SETUP_DEFAULT_OPTIONS()
NL_SETUP_NEL_DEFAULT_OPTIONS()
NL_SETUP_RYZOM_DEFAULT_OPTIONS()
NL_SETUP_BUILD()
NL_SETUP_BUILD_FLAGS()
NL_SETUP_PREFIX_PATHS()
RYZOM_SETUP_PREFIX_PATHS()
#-----------------------------------------------------------------------------
#Platform specifics
SETUP_EXTERNAL()
NL_CONFIGURE_CHECKS()
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/PCHSupport.cmake)
IF(FINAL_VERSION)
ADD_DEFINITIONS(-DFINAL_VERSION=1)
ENDIF()
IF(WITH_SSE2)
ADD_DEFINITIONS(-DNL_HAS_SSE2)
IF(WITH_SSE3)
ADD_DEFINITIONS(-DNL_HAS_SSE3)
ENDIF()
ENDIF()
# FIND_PACKAGE(NeL COMPONENTS 3d misc pacs sound nimp REQUIRED)
FIND_PACKAGE(NeL REQUIRED)
INCLUDE_DIRECTORIES(${NEL_INCLUDE_DIRS})
#-----------------------------------------------------------------------------
#Platform specifics
FIND_PACKAGE(RyzomGameShare REQUIRED)
INCLUDE_DIRECTORIES(${RYZOM_GAMESHARE_INCLUDE_DIRS})
SET(RZ_SERVER_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
# Need servershare for build packed collision tool
# Need aishare for build wmap tool
FIND_PACKAGE(MySQL REQUIRED)
FIND_PACKAGE(Mongo)
IF(MONGO_FOUND)
SET(MONGO_DEFINITIONS -DHAVE_MONGO)
ENDIF()
ADD_SUBDIRECTORY(src)