-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (48 loc) · 1.65 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
PROJECT(arma-ws)
FILE(GLOB SOURCES arma-ws/*.cpp)
INCLUDE_DIRECTORIES(arma-ws)
SET(CMAKE_CXX_STANDARD 11)
# -----------------------
# START STATIC LIBRARIES
# -----------------------
# I know..... but it works :)
# BOOST
IF(DEFINED ENV{BOOST_ROOT})
IF(EXISTS "$ENV{BOOST_ROOT}/boost/filesystem.hpp")
MESSAGE(STATUS "BOOST include directory: $ENV{BOOST_ROOT}")
INCLUDE_DIRECTORIES($ENV{BOOST_ROOT})
ELSE()
MESSAGE(FATAL_ERROR "\nBOOST is found but:\n BOOST_ROOT/boost not found")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "\nBOOST not found\n Please Set BOOST_ROOT")
ENDIF()
IF(DEFINED ENV{BOOST_LIBRARYDIR})
FILE(GLOB BOOST_LIBS $ENV{BOOST_LIBRARYDIR}/*.a
$ENV{BOOST_LIBRARYDIR}/*.lib)
LIST(LENGTH BOOST_LIBS BOOST_LIBS_LENGTH)
IF(${BOOST_LIBS_LENGTH} GREATER 0)
MESSAGE(STATUS "BOOST library directory: $ENV{BOOST_LIBRARYDIR}")
LINK_DIRECTORIES($ENV{BOOST_LIBRARYDIR})
ELSE()
MESSAGE(FATAL_ERROR "\nBOOST is found but:\n BOOST_LIBRARYDIR does not contain any libraries")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "\nBOOST not found\n Please Set BOOST_LIBRARYDIR")
ENDIF()
# WEBSOCKETPP
IF(DEFINED ENV{WEBSOCKETPP_ROOT})
IF(EXISTS "$ENV{WEBSOCKETPP_ROOT}/websocketpp/server.hpp")
MESSAGE(STATUS "WEBSOCKETPP include directory: $ENV{WEBSOCKETPP_ROOT}")
INCLUDE_DIRECTORIES($ENV{WEBSOCKETPP_ROOT})
ELSE()
MESSAGE(FATAL_ERROR "\nWEBSOCKETPP is found but:\n WEBSOCKETPP_ROOT/boost not found")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "\nWEBSOCKETPP not found\n Please Set WEBSOCKETPP_ROOT")
ENDIF()
# -----------------------
# END STATIC LIBRARIES
# -----------------------
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SOURCES})