This repository has been archived by the owner on Jun 27, 2020. It is now read-only.
forked from eressea/server
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
75 lines (62 loc) · 2.18 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
cmake_minimum_required(VERSION 2.8)
if (WIN32)
FILE(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH )
FILE(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH )
endif(WIN32)
project (eressea-server C)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
if (MSVC)
find_package (PDCurses)
set (CURSES_FOUND ${PDCURSES_FOUND})
set (CURSES_LIBRARIES ${PDCURSES_LIBRARY})
set (CURSES_INCLUDE_DIR ${PDCURSES_INCLUDE_DIR})
set (HAVE_STRDUP 0)
set (HAVE_STRLCAT 0)
set (HAVE_LIBBSD 0)
set (HAVE_SIGNAL_H 0)
set (HAVE_EXECINFO_H 0)
include (MSVC)
else (MSVC)
find_package (Curses)
include (CheckIncludeFile)
CHECK_INCLUDE_FILE(signal.h HAVE_SIGNAL_H)
CHECK_INCLUDE_FILE(execinfo.h HAVE_EXECINFO_H)
CHECK_INCLUDE_FILE(bsd/string.h HAVE_LIBBSD)
include (CheckFunctionExists)
CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
if (HAVE_LIBBSD)
include (CheckLibraryExists)
CHECK_LIBRARY_EXISTS(bsd strlcat "bsd/string.h" HAVE_STRLCAT)
else (HAVE_LIBBSD)
CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
endif (HAVE_LIBBSD)
endif (MSVC)
find_package (Readline)
if (ERESSEA_DB STREQUAL "db")
find_package (BerkeleyDB REQUIRED QUIET)
else()
find_package (SQLite3 REQUIRED QUIET)
endif()
find_package(EXPAT REQUIRED)
find_package (ToLua REQUIRED)
if (TOLUA_FOUND)
if (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.2")
find_package (Lua 5.2 REQUIRED)
else ()
find_package (Lua51 REQUIRED)
endif()
endif(TOLUA_FOUND)
enable_testing()
add_subdirectory (cJSON)
add_subdirectory (storage)
add_subdirectory (iniparser)
add_subdirectory (clibs)
add_subdirectory (process)
add_subdirectory (src eressea)
install(DIRECTORY etc DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.txt")
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.po")
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.xml")
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.json")
install(DIRECTORY scripts DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.lua")
install(DIRECTORY lunit DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.lua")
install(DIRECTORY share DESTINATION ${CMAKE_INSTALL_PREFIX})