-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
66 lines (51 loc) · 1.75 KB
/
CMakeLists.txt
File metadata and controls
66 lines (51 loc) · 1.75 KB
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
cmake_minimum_required(VERSION 3.8)
project(MiServerxx VERSION 0.0.1)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.in"
"${CMAKE_CURRENT_SOURCE_DIR}/include/MiServerxx/config.h"
)
set(MiServer_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include/)
set(MiServer_CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include_directories("${MiServer_INCLUDE_DIRS}" "${CMAKE_CURRENT_SOURCE_DIR}/lib/MiRak/include" "${CMAKE_CURRENT_SOURCE_DIR}/lib/glm/glm")
list(APPEND CMAKE_MODULE_PATH ${MiServer_CMAKE_MODULE_PATH})
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
message("Compiling with Debug option")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gdwarf-2")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf-2")
endif()
if(CMAKE_BUILD_TYPE MATCHES Release)
message("Compiling in Release mode")
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# MiServerxx Platform configuration
option(MiServer_PLATFORM_WIN32 "MiServerxx platform Win32" OFF)
option(MiServer_PLATFORM_UNIX "MiServerxx platform Unix" OFF)
if(MiServer_PLATFORM_WIN32)
message("Detected Windows platform")
link_libraries(ws2_32)
elseif(MiServer_PLATFORM_UNIX)
message("Detected Unix platform")
else()
message(FATAL_ERROR "Unsupported platform")
endif()
if (MSVC)
add_definitions("/MP")
else()
set(CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}")
endif()
option(MiServer_TESTS_OPT "Build tests" OFF)
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/install)
# MiServerxx lib
add_subdirectory(source)
# MiServerxx deps
add_subdirectory(lib)
# MiServerxx tests
if(MiServer_TESTS_OPT)
add_subdirectory(tests)
message(STATUS "Tests enabled")
endif()