forked from facebookarchive/RakNet
-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists.txt
60 lines (42 loc) · 1.52 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
cmake_minimum_required(VERSION 3.5)
project(CrabNet)
set(CMAKE_CXX_STANDARD 11)
if (NOT APPLE)
# check 64 bit
if (CMAKE_SIZEOF_VOID_P MATCHES "4")
set(HAVE_64_BIT 0)
else (CMAKE_SIZEOF_VOID_P MATCHES "4")
set(HAVE_64_BIT 1)
endif (CMAKE_SIZEOF_VOID_P MATCHES "4")
endif (NOT APPLE)
IF (WIN32 AND NOT UNIX)
set(PROGRAMFILESX86 $ENV{PROGRAMFILES})
string(REPLACE "\\" "/" PROGRAMFILESX86 ${PROGRAMFILESX86})
ENDIF (WIN32 AND NOT UNIX)
set(CMAKE_DEBUG_POSTFIX "d")
IF (WIN32 AND NOT UNIX)
set(CRABNET_LIBRARY_LIBS ws2_32.lib)
set(CRABNET_LIBRARY_SO_NAME RakNetDLL)
ELSE (WIN32 AND NOT UNIX)
set(CRABNET_LIBRARY_LIBS pthread)
set(CRABNET_LIBRARY_SO_NAME raknet)
ENDIF (WIN32 AND NOT UNIX)
# Options
option(CRABNET_ENABLE_SAMPLES "Generate RakNet sample projects." FALSE)
option(CRABNET_ENABLE_DLL "Generate the DLL project." TRUE)
option(CRABNET_ENABLE_STATIC "Generate the static library project." TRUE)
option(CRABNET_ENABLE_PVS "Enable PVS Studio Analyzer" FALSE)
option(CRABNET_ENABLE_LIBCAT_SECURITY "Enable secure connection support." FALSE)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CmakeIncludes)
include(CmakeMacros)
include(PVS-Studio)
if (MSVC)
FIXLINKOPTIONS()
FIXCOMPILEOPTIONS()
endif (MSVC)
include_directories(SYSTEM include/raknet DependentExtensions Source)
add_subdirectory(lib)
set(CRABNET_COMMON_LIBS RakNetLibStatic)
if (CRABNET_ENABLE_SAMPLES)
add_subdirectory(Samples)
endif ()