This repository has been archived by the owner on Mar 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
65 lines (51 loc) · 1.86 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
cmake_minimum_required(VERSION 2.8)
if(WIN32)
set(ZLIB_LIBRARY "C:/users/adam/desktop/zlib/libz.lib")
set(ZLIB_INCLUDE_DIR "C:/users/adam/desktop/zlib/")
set(FLEX_EXECUTABLE "C:/users/adam/desktop/flex-2.5.4a-1-bin/bin/flex.exe")
set(BISON_EXECUTABLE "C:/users/adam/desktop/bison-2.4.1-bin/bin/bison.exe")
set(EVENT_INCLUDE_DIR "C:/Users/Adam/Desktop/libevent-2.0.21-stable/include")
set(EVENT_LIBRARY "C:/Users/Adam/Desktop/libevent-2.0.21-stable/libevent.lib")
endif(WIN32)
project(bedrock C)
if(WIN32)
add_definitions(-DWIN32)
endif(WIN32)
# include cmake stuff for checking various system specific defines
include(CheckTypeSize)
# Check type sizes since we need them
check_type_size(int8_t INT8_T)
check_type_size(uint8_t UINT8_T)
check_type_size(int16_t INT16_T)
check_type_size(uint16_t UINT16_T)
check_type_size(int32_t INT32_T)
check_type_size(uint32_t UINT32_T)
check_type_size(int64_t INT64_T)
check_type_size(uint64_t UINT64_T)
include(CheckIncludeFiles)
CHECK_INCLUDE_FILES("valgrind/valgrind.h" HAVE_VALGRIND_H)
configure_file(include/util/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/include/util/config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/util/)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# required packages for compile
find_package(ZLIB REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(libevent REQUIRED)
find_package(libyaml REQUIRED)
find_package(libjansson REQUIRED)
if(NOT WIN32)
find_package(Curses)
endif(NOT WIN32)
if(NOT WIN32)
set(CMAKE_C_FLAGS "-g -pipe -Wall -Wextra -std=gnu99 -pedantic")
else(NOT WIN32)
include_directories(win32)
add_subdirectory(win32)
endif(NOT WIN32)
add_subdirectory(console)
add_subdirectory(nbt)
add_subdirectory(server)
add_subdirectory(util)
install(FILES config.yml.example DESTINATION .)
install(DIRECTORY include DESTINATION .)
install(DIRECTORY data DESTINATION .)