forked from crossbario/autobahn-cpp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
104 lines (95 loc) · 5.01 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
# Use this for installing AutobahnCpp into <prefix>/include.
cmake_minimum_required(VERSION 2.8)
project(autobahn-cpp)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "-stdlib=libc++ -Wno-unused-local-typedefs -Wno-unknown-warning-option ${CMAKE_CXX_FLAGS}")
if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
set(CMAKE_CXX_FLAGS "-fcolor-diagnostics ${CMAKE_CXX_FLAGS}")
endif()
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9.0") # i.e. if >= 4.9.0
if (CMAKE_GENERATOR STREQUAL "Ninja")
set(CMAKE_CXX_FLAGS "-fdiagnostics-color=always ${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_CXX_FLAGS "-fdiagnostics-color=auto ${CMAKE_CXX_FLAGS}")
endif()
endif()
endif()
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Werror -Wno-unused-variable ${CMAKE_CXX_FLAGS}")
endif()
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(Boost REQUIRED COMPONENTS program_options system thread random)
find_package(Websocketpp REQUIRED)
find_package(Msgpack REQUIRED)
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
set(PUBLIC_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/autobahn.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/boost_config.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/exceptions.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_arguments.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_auth_utils.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_authenticate.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_authenticate.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_call.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_call.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_call_options.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_call_options.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_call_result.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_call_result.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_challenge.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_challenge.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_event.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_event.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_event_handler.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_invocation.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_invocation.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_message.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_message.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_message_type.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_message_type.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_procedure.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_publication.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_publication.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_rawsocket_transport.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_rawsocket_transport.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_register_request.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_register_request.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_registration.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_registration.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_transport.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_transport_handler.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_session.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_session.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_subscribe_options.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_subscribe_options.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_subscribe_request.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_subscribe_request.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_subscription.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_subscription.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_tcp_transport.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_tcp_transport.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_transport_handler.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_transport.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_uds_transport.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_unregister_request.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_unregister_request.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_unsubscribe_request.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_unsubscribe_request.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_websocket_transport.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_websocket_transport.ipp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_websocketpp_websocket_transport.hpp
${CMAKE_CURRENT_SOURCE_DIR}/autobahn/wamp_websocketpp_websocket_transport.ipp
)
foreach(h ${PUBLIC_HEADERS})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "include/" include "${h}")
get_filename_component(HEADER_INCLUDE_DIRECTORY ${include} DIRECTORY)
install(FILES ${h}
DESTINATION ${HEADER_INCLUDE_DIRECTORY}
COMPONENT "headers")
endforeach()
add_subdirectory(examples)