-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
116 lines (97 loc) · 3.92 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
cmake_minimum_required(VERSION 2.8.2)
project(cdynastat)
include(DownloadProject.cmake)
enable_testing()
add_definitions(-DWEBRTC_POSIX)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules/")
# https://github.com/Crascit/DownloadProject/blob/master/CMakeLists.txt
if (CMAKE_VERSION VERSION_LESS 3.2)
set(UPDATE_DISCONNECTED_IF_AVAILABLE "")
else ()
set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
IF(APPLE)
#SET(GUI_TYPE MACOSX_BUNDLE)
INCLUDE_DIRECTORIES ( /Developer/Headers/FlatCarbon )
FIND_LIBRARY(CARBON_LIBRARY Carbon)
FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime )
FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
SET(BOOST_ROOT /usr/local/opt/boost155)
SET(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
LINK_DIRECTORIES(/usr/local/opt/boost155/lib)
MARK_AS_ADVANCED (CARBON_LIBRARY
QUICKTIME_LIBRARY
APP_SERVICES_LIBRARY)
SET(EXTRA_LIBS ${CARBON_LIBRARY} ${QUICKTIME_LIBRARY} ${APP_SERVICES_LIBRARY})
set(CMAKE_EXE_LINKER_FLAGS "-framework ServiceManagement -framework Foundation -framework Cocoa -framework AudioToolbox -framework AudioUnit -framework CoreAudio")
ENDIF ()
# Dependancy includes
MESSAGE ( STATUS "Searching for X11..." )
FIND_PACKAGE ( X11 REQUIRED )
IF ( X11_FOUND )
INCLUDE_DIRECTORIES ( ${X11_INCLUDE_DIR} )
LINK_LIBRARIES ( ${X11_LIBRARIES} )
MESSAGE ( STATUS " X11_INCLUDE_DIR: " ${X11_INCLUDE_DIR} )
MESSAGE ( STATUS " X11_LIBRARIES: " ${X11_LIBRARIES} )
ENDIF ( X11_FOUND )
MESSAGE( STATUS "Searching for OpenSSL")
FIND_PACKAGE( OpenSSL REQUIRED )
IF ( OPENSSL_FOUND )
INCLUDE_DIRECTORIES( ${OPENSSL_INCLUDE_DIR} )
# LINK_LIBRARIES( ${OPENSSL_LIBRARIES} )
MESSAGE( STATUS " OpenSSL_INCLUDE_DIR: " ${OPENSSL_INCLUDE_DIR} )
MESSAGE( STATUS " OpenSSL_LIBRARIES: " ${OPENSSL_LIBRARIES} )
ENDIF ( OPENSSL_FOUND )
MESSAGE ( STATUS "Searching for Boost" )
FIND_PACKAGE ( Boost 1.55 REQUIRED COMPONENTS thread system )
IF ( Boost_FOUND )
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
LINK_LIBRARIES( ${Boost_LIBRARIES} )
MESSAGE( STATUS " Boost_INCLUDE_DIR: " ${Boost_INCLUDE_DIR} )
MESSAGE( STATUS " Boost_LIBRARIES: " ${Boost_LIBRARIES} )
ENDIF ( Boost_FOUND )
MESSAGE ( STATUS "Searing for yaml-cpp")
FIND_PACKAGE( YamlCpp REQUIRED )
# Project includes
link_directories(lib)
include_directories(include)
IF (NOT DEFINED ARCH)
SET(ARCH "amd64")
ENDIF ()
download_project(PROJ websocketpp
GIT_REPOSITORY https://github.com/zaphoyd/websocketpp.git
GIT_TAG 0.6.0
${UPDATE_DISCONNECTED_IF_AVAILABLE}
)
add_subdirectory(${websocketpp_SOURCE_DIR} ${websocketpp_BINARY_DIR} EXCLUDE_FROM_ALL)
include_directories(${websocketpp_SOURCE_DIR})
set(LIBWEBRTC libwebrtc-${CMAKE_SYSTEM_NAME}-${ARCH}-r49.a)
# gtest DownloadProject
download_project(PROJ googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
${UPDATE_DISCONNECTED_IF_AVAILABLE}
)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
# msgpack DownloadProject
download_project(PROJ msgpack
GIT_REPOSITORY https://github.com/msgpack/msgpack-c.git
GIT_TAG cpp-2.0.0
${UPDATE_DISCONNECTED_IF_AVAILABLE}
)
add_subdirectory(${msgpack_SOURCE_DIR} ${msgpack_BINARY_DIR} EXCLUDE_FROM_ALL)
include_directories("${msgpack_SOURCE_DIR}/include")
# When using CMake 2.8.11 or later, header path dependencies
# are automatically added to the gtest and gmock targets.
# For earlier CMake versions, we have to explicitly add the
# required directories to the header search path ourselves.
#if (CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories("${gtest_SOURCE_DIR}/include"
"${gmock_SOURCE_DIR}/include")
#endif()
# Main executable
SET(SOURCE_DIR ${CMAKE_SOURCE_DIR}/src)
add_subdirectory(src)
# Test definitions
add_subdirectory(test)