-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
105 lines (82 loc) · 3.17 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
#-----------------------------------------------------------------------------
#
# MTP Target
# Author: Vialek
#
# Notes:
# * Changing install location: add -DCMAKE_INSTALL_PREFIX:PATH=/my/new/path
# * Changing NeL prefix: add -DNEL_PREFIX_PATH:PATH=/my/nel/install
#
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Load some macros.
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
INCLUDE(CMakeModules/nel.cmake)
#-----------------------------------------------------------------------------
# Force out of source builds.
CHECK_OUT_OF_SOURCE()
IF(WIN32)
SET(CMAKE_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/../3rdParty/include;${CMAKE_INCLUDE_PATH}")
SET(CMAKE_LIBRARY_PATH "${CMAKE_SOURCE_DIR}/../3rdParty/lib;${CMAKE_LIBRARY_PATH}")
ENDIF(WIN32)
IF(DEFINED NEL_PREFIX_PATH)
SET(CMAKE_INCLUDE_PATH "${NEL_PREFIX_PATH}/include;${CMAKE_INCLUDE_PATH}")
SET(CMAKE_LIBRARY_PATH "${NEL_PREFIX_PATH}/lib;${CMAKE_LIBRARY_PATH}")
ENDIF(DEFINED NEL_PREFIX_PATH)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(Tux-Target CXX C)
SET(TUX_VERSION_MAJOR 1)
SET(TUX_VERSION_MINOR 19)
SET(TUX_VERSION_PATCH 0)
SET(TUX_VERSION "${TUX_VERSION_MAJOR}.${TUX_VERSION_MINOR}.${TUX_VERSION_PATCH}")
#-----------------------------------------------------------------------------
# Redirect output files
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
#-----------------------------------------------------------------------------
# Set CMake 2.6 Policies.
IF(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
ENDIF(COMMAND cmake_policy)
#-----------------------------------------------------------------------------
# Set default config options
#
NL_SETUP_DEFAULT_OPTIONS()
NL_SETUP_PREFIX_PATHS()
#-----------------------------------------------------------------------------
# Override default options
OPTION(BUILD_CLIENT "Build the Mtp Target Client" ON)
OPTION(BUILD_SERVER "Build the Tux Target Servers" ON)
SET(TUX_TARGET_CONFIG_DIR "${NL_ETC_PREFIX}/tux-target" CACHE FILEPATH "Tux Target config file location")
SET(TUX_TARGET_DATA_DIR "${NL_SHARE_PREFIX}/games/tux-target" CACHE FILEPATH "Tux Target data file location")
#-----------------------------------------------------------------------------
#Platform specifics
FIND_PACKAGE(Threads REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(ZLIB REQUIRED)
NL_SETUP_BUILD()
FIND_PACKAGE(NeL COMPONENTS nelmisc nelnet nel3d REQUIRED)
IF(BUILD_CLIENT)
FIND_PACKAGE(CURL REQUIRED)
FIND_PACKAGE(Lua50 REQUIRED)
FIND_PACKAGE(NeL COMPONENTS nelsound nelsnd_lowlevel REQUIRED)
IF(WIN32)
FIND_PACKAGE(Jpeg)
FIND_PACKAGE(PNG)
FIND_PACKAGE(FreeType)
FIND_PACKAGE(SSLEAY REQUIRED)
ENDIF(WIN32)
ENDIF(BUILD_CLIENT)
IF(BUILD_SERVER)
FIND_PACKAGE(ODE REQUIRED)
FIND_PACKAGE(MySQL REQUIRED)
ENDIF(BUILD_SERVER)
NL_SETUP_BUILD_FLAGS()
ADD_DEFINITIONS(-DTUX_TARGET_CONFIG_DIR="${TUX_TARGET_CONFIG_DIR}/")
IF(BUILD_CLIENT)
ADD_SUBDIRECTORY(client)
ENDIF(BUILD_CLIENT)
IF(BUILD_SERVER)
ADD_SUBDIRECTORY(server)
# ADD_SUBDIRECTORY(login_service)
ENDIF(BUILD_SERVER)