This repository has been archived by the owner on Dec 1, 2018. It is now read-only.
/
CMakeLists.txt
74 lines (66 loc) · 3.22 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
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(Serveur)
include_directories(include)
include_directories(src/block)
include_directories(src/command)
include_directories(src/database)
include_directories(src/entity)
include_directories(src/inventory)
include_directories(src/item)
include_directories(src/nbt)
include_directories(src/network)
include_directories(src/packet)
include_directories(src/server)
include_directories(src/util)
include_directories(src/world)
file(GLOB_RECURSE BLOCK_C src/block/*.cpp)
file(GLOB_RECURSE BLOCK_H src/block/*.h)
file(GLOB_RECURSE COMMAND_C src/command/*.cpp)
file(GLOB_RECURSE COMMAND_H src/command/*.h)
file(GLOB_RECURSE DATABASE_C src/database/*.cpp)
file(GLOB_RECURSE DATABASE_H src/database/*.h)
file(GLOB_RECURSE ENTITY_C src/entity/*.cpp)
file(GLOB_RECURSE ENTITY_H src/entity/*.h)
file(GLOB_RECURSE INVENTORY_C src/inventory/*.cpp)
file(GLOB_RECURSE INVENTORY_H src/inventory/*.h)
file(GLOB_RECURSE ITEM_C src/item/*.cpp)
file(GLOB_RECURSE ITEM_H src/item/*.h)
file(GLOB_RECURSE NBT_C src/nbt/*.cpp)
file(GLOB_RECURSE NBT_H src/nbt/*.h)
file(GLOB_RECURSE NETWORK_C src/network/*.cpp)
file(GLOB_RECURSE NETWORK_H src/network/*.h)
file(GLOB_RECURSE PACKET_C src/packet/*.cpp)
file(GLOB_RECURSE PACKET_H src/packet/*.h)
file(GLOB_RECURSE SERVER_C src/server/*.cpp)
file(GLOB_RECURSE SERVER_H src/server/*.h)
file(GLOB_RECURSE UTIL_C src/util/*.cpp)
file(GLOB_RECURSE UTIL_H src/util/*.h)
file(GLOB_RECURSE WORLD_C src/world/*.cpp)
file(GLOB_RECURSE WORLD_H src/world/*.h)
set(SOURCE_FILES ${BLOCK_C} ${COMMAND_C} ${DATABASE_C} ${ENTITY_C} ${INVENTORY_C} ${ITEM_C} ${NBT_C} ${NETWORK_C} ${PACKET_C} ${SERVER_C} ${UTIL_C} ${WORLD_C})
set(HEADER_FILES ${BLOCK_H} ${COMMAND_H} ${DATABASE_H} ${ENTITY_H} ${INVENTORY_H} ${ITEM_H} ${NBT_H} ${NETWORK_H} ${PACKET_H} ${SERVER_H} ${UTIL_H} ${WORLD_H})
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -pthread")
endif()
add_executable(Serveur ${SOURCE_FILES} ${HEADER_FILES})
source_group("Block" FILES ${BLOCK_C} ${BLOCK_H})
source_group("Command" FILES ${COMMAND_C} ${COMMAND_H})
source_group("Database" FILES ${DATABASE_C} ${DATABASE_H})
source_group("Entity" FILES ${ENTITY_C} ${ENTITY_H})
source_group("Inventory" FILES ${INVENTORY_C} ${INVENTORY_H})
source_group("Item" FILES ${ITEM_C} ${ITEM_H})
source_group("NBT" FILES ${NBT_C} ${NBT_H})
source_group("Network" FILES ${NETWORK_C} ${NETWORK_H})
source_group("Packet" FILES ${PACKET_C} ${PACKET_H})
source_group("Server" FILES ${SERVER_C} ${SERVER_H})
source_group("Util" FILES ${UTIL_C} ${UTIL_H})
source_group("World" FILES ${WORLD_C} ${WORLD_H})
target_link_libraries(Serveur ${PROJECT_SOURCE_DIR}/lib/libmongoclient.a)
target_link_libraries(Serveur ${PROJECT_SOURCE_DIR}/lib/libz.a)
target_link_libraries(Serveur ${PROJECT_SOURCE_DIR}/lib/libboost_filesystem.a)
target_link_libraries(Serveur ${PROJECT_SOURCE_DIR}/lib/libboost_program_options.a)
target_link_libraries(Serveur ${PROJECT_SOURCE_DIR}/lib/libboost_regex.a)
target_link_libraries(Serveur ${PROJECT_SOURCE_DIR}/lib/libboost_system.a)
target_link_libraries(Serveur ${PROJECT_SOURCE_DIR}/lib/libboost_thread.a)