forked from cocaine/cocaine-plugins
-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
104 lines (89 loc) · 2.94 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(COCAINE-PLUGINS)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# Choose new behaviour for CMP0042.
# See http://www.cmake.org/cmake/help/v3.0/policy/CMP0042.html for more details.
if (POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif (POLICY CMP0042)
IF(APPLE)
OPTION(ELASTICSEARCH "Build ElasticSearch Service plugin" OFF)
OPTION(ELLIPTICS "Build Elliptics Storage Service plugin" OFF)
OPTION(IPVS "Build IPVS Gateway Service plugin" OFF)
OPTION(URLFETCH "Build URLFetch Service plugin" OFF)
ELSE()
OPTION(ELASTICSEARCH "Build ElasticSearch Service plugin" ON)
OPTION(ELLIPTICS "Build Elliptics Storage Service plugin" ON)
OPTION(IPVS "Build IPVS Gateway Service plugin" ON)
OPTION(URLFETCH "Build URLFetch Service plugin" ON)
ENDIF()
OPTION(CACHE "Build LRU Cache plugin" ON)
OPTION(CHRONO "Build Chrono Service plugin" ON)
OPTION(DOCKER "Build Docker Isolation plugin" ON)
OPTION(GRAPHITE "Build Graphite Service plugin" ON)
OPTION(LOGGING "Build logging v2 service plugin" ON)
OPTION(METRICS "Build metrics service plugin" ON)
OPTION(MONGO "Build MongoDB Storage plugin" OFF)
OPTION(NODE "Build Node service plugin" ON)
OPTION(POSTGRES "Build Postgress index storage plugin" ON)
OPTION(UNICAT "Build Unified cocaine acl tooling plugin" ON)
OPTION(UNICORN "Build Unified configuration service plugin" ON)
OPTION(UNIRESIS "Build Unified resource tracking plugin" ON)
OPTION(VICODYN "Build virtual cocaine dynamic proxy service plugin" ON)
# Include our CMake libraries.
INCLUDE(cmake/locate_library.cmake)
FIND_PACKAGE(Boost 1.46.0
REQUIRED COMPONENTS
system
filesystem
thread)
LOCATE_LIBRARY(LIBCOCAINE "cocaine/context.hpp" "cocaine-core")
LOCATE_LIBRARY(LIBMSGPACK "msgpack.hpp" "msgpack")
# System is required to get rid of errors in foreign libs
INCLUDE_DIRECTORIES(
SYSTEM
${Boost_INCLUDE_DIRS}
${LIBCOCAINE_INCLUDE_DIRS}
${LIBMSGPACK_INCLUDE_DIRS})
# System is required to get rid of errors in foreign libs
INCLUDE_DIRECTORIES(BEFORE
SYSTEM
${PROJECT_SOURCE_DIR}/foreign/asio/asio/include
${PROJECT_SOURCE_DIR}/foreign/rapidjson/include)
LINK_DIRECTORIES(
${Boost_LIBRARY_DIRS}
${LIBCOCAINE_LIBRARY_DIRS}
${LIBMSGPACK_LIBRARY_DIRS})
SET(PLUGINS
cache
chrono
docker
elasticsearch
elliptics
graphite
ipvs
logging
metrics
mongo
node
postgres
unicat
unicorn
uniresis
urlfetch
vicodyn
)
IF("${CMAKE_SHARED_LIBRARY_SUFFIX}" STREQUAL "")
SET(COCAINE_PLUGIN_SUFFIX ".cocaine-plugin")
ELSE()
SET(COCAINE_PLUGIN_SUFFIX ".cocaine-plugin${CMAKE_SHARED_LIBRARY_SUFFIX}")
ENDIF()
SET(PLUGINS_VERSION 3)
FOREACH(PLUGIN ${PLUGINS})
STRING(TOUPPER ${PLUGIN} OPTION_NAME)
IF(${${OPTION_NAME}})
message(STATUS "Configuring ${PLUGIN} plugin")
ADD_SUBDIRECTORY(${PLUGIN})
message(STATUS "Configuring ${PLUGIN} plugin - done")
ENDIF()
ENDFOREACH(PLUGIN)