This repository has been archived by the owner on Nov 22, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
63 lines (53 loc) · 1.51 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
###
# CMake entry point
###
cmake_minimum_required (VERSION 2.8)
project (server-test)
###
# Predefines to block make at the root
###
if( CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR )
message( FATAL_ERROR "Please select another Build Directory ! (and give it a clever name, like bin_Visual2012_64bits/)" )
endif()
if( CMAKE_SOURCE_DIR MATCHES " " )
message( "Your Source Directory contains spaces. If you experience problems when compiling, this can be the cause." )
endif()
if( CMAKE_BINARY_DIR MATCHES " " )
message( "Your Build Directory contains spaces. If you experience problems when compiling, this can be the cause." )
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SDL_SHARED_ENABLED_BY_DEFAULT OFF CACHE BOOL "Generate the DLL project if true.")
###
# Compile vendor dependencies
###
add_subdirectory(vendor/reguider)
add_subdirectory(vendor/SDL)
###
# Includes for libs and remote sources
###
include_directories(
vendor/reguider/include
vendor/SDL/include
server/
shared/
)
###
# Includes for current source executable
###
file(GLOB_RECURSE SERVER_FILES "${PROJECT_SOURCE_DIR}/server/*.cpp")
file(GLOB_RECURSE CLIENT_FILES "${PROJECT_SOURCE_DIR}/client/*.cpp")
if(MSVC)
GroupSources(client)
GroupSources(server)
GroupSources(shared)
endif()
###
# Adding executables
###
add_executable(server ${SERVER_FILES})
add_executable(client ${CLIENT_FILES})
###
# Linking libraries
###
target_link_libraries(server librg)
target_link_libraries(client librg SDL2main SDL2-static)