forked from ComputerScienceHouse/bingehack4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
77 lines (60 loc) · 1.93 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
# CMakeLists.txt for NetHack4 4.2.0
cmake_minimum_required (VERSION 2.8.3)
project (NetHack4 C)
if (WIN32)
set(INSTALL_BASE "$ENV{USERPROFILE}")
else ()
set(INSTALL_BASE "$ENV{HOME}")
endif ()
# default installation paths in $HOME/nethack4
if (NOT BINDIR)
set (BINDIR "${INSTALL_BASE}/nethack4/nethack4-data"
CACHE PATH "binary location" )
endif()
if (NOT LIBDIR)
set (LIBDIR "${INSTALL_BASE}/nethack4/nethack4-data"
CACHE PATH "library location" )
endif()
if (NOT DATADIR)
set (DATADIR "${INSTALL_BASE}/nethack4/nethack4-data"
CACHE PATH "data location" )
endif()
if (NOT SHELLDIR)
set (SHELLDIR "${INSTALL_BASE}/nethack4"
CACHE PATH "launch script location" )
endif()
set (ALL_STATIC FALSE CACHE BOOL "Fully static build")
if (NOT ALL_STATIC)
set (LIB_TYPE SHARED)
else ()
add_definitions(-fPIC -DSTATIC_BUILD)
set (LIB_TYPE STATIC)
endif ()
set (WIZARD "wizard" CACHE STRING "The person allowed to use the -D option")
add_definitions (-DWIZARD="${WIZARD}")
set (ENABLE_NETCLIENT TRUE CACHE BOOL "Enable network client mode")
# NetHack4 server currently uses several Linux-specific apis.
# Generalizing the code to the point where it will work on other systems
# is not impossible, but the work has not been done.
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set (ENABLE_SERVER TRUE CACHE BOOL "Build the NetHack4 network server")
else ()
set (ENABLE_SERVER FALSE)
endif ()
if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS_DEBUG "-Wall -g3 -Wold-style-definition -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith")
if (UNIX)
add_definitions (-fvisibility=hidden)
endif ()
endif ()
# nethack4 core
add_subdirectory (libnethack)
# nethack4 network client
if (ENABLE_NETCLIENT)
add_subdirectory (libnethack_client)
endif ()
# nethack4 text ui
add_subdirectory (nethack)
if (ENABLE_SERVER)
add_subdirectory (nethack_server)
endif ()