File: CMakeLists.txt

package info (click to toggle)
evqueue-core 2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,312 kB
  • sloc: cpp: 16,147; sql: 274; sh: 122; ansic: 72; makefile: 11
file content (180 lines) | stat: -rw-r--r-- 7,967 bytes parent folder | download
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
cmake_minimum_required(VERSION 2.8)

set(EVQUEUE_VERSION "2.0")

set(CMAKE_BUILD_TYPE Release)

project(evqueue)

# Detect libgit2 library
find_library(HAS_LIBGIT2 libgit2.so)
find_library(HAS_STATICLIBGIT2 libgit2.a)

# We prefer shared version
if(HAS_LIBGIT2)
	option(USELIBGIT2 "Enable libgit2 support" ON)
else()
	option(USELIBGIT2 "Enable libgit2 support" OFF)
	
	# Shared version is not available, try static one
	if(HAS_STATICLIBGIT2)
		option(USESTATICLIBGIT2 "Enable static libgit2 support" ON)
	else()
		option(USESTATICLIBGIT2 "Enable static libgit2 support" OFF)
	endif(HAS_STATICLIBGIT2)
endif(HAS_LIBGIT2)

add_definitions(-DEVQUEUE_VERSION="${EVQUEUE_VERSION}")

add_executable(evqueue
	src/evqueue.cpp src/Configuration.cpp src/ConfigurationReader.cpp src/DB.cpp src/Exception.cpp
	src/Queue.cpp src/QueuePool.cpp src/WorkflowInstance.cpp src/WorkflowInstances.cpp src/Scheduler.cpp
	src/Retrier.cpp src/SocketQuerySAX2Handler.cpp src/ProcessManager.cpp src/WorkflowParameters.cpp
	src/handle_connection.cpp src/Statistics.cpp src/NetworkInputSource.cpp src/BinNetworkInputStream.cpp
	src/Schedule.cpp src/WorkflowSchedule.cpp src/WorkflowScheduler.cpp src/Tasks.cpp src/Task.cpp
	src/Workflow.cpp src/Workflows.cpp src/Logger.cpp src/GarbageCollector.cpp src/RetrySchedule.cpp
	src/RetrySchedules.cpp src/SequenceGenerator.cpp src/tools.cpp src/tools_ipc.cpp src/Notification.cpp
	src/Notifications.cpp src/Sockets.cpp src/FileManager.cpp src/base64.cpp src/tables.cpp src/tools_db.cpp
	src/workflow.xsd.cpp src/XMLUtils.cpp src/QueryHandlers.cpp src/QueryResponse.cpp src/Cluster.cpp src/ping.cpp
	src/SocketResponseSAX2Handler.cpp src/LibGit2.cpp src/retry_schedule.xsd.cpp src/WorkflowSchedules.cpp
	src/NotificationType.cpp src/NotificationTypes.cpp src/sha1.c src/WorkflowInstanceAPI.cpp src/SocketSAX2Handler.cpp
	src/hmac.cpp src/AuthHandler.cpp src/User.cpp src/Users.cpp src/Logs.cpp src/ClientBase.cpp src/Client.cpp
	src/ActiveConnections.cpp src/Git.cpp src/Sha1String.cpp src/pbkdf2.cpp src/Random.cpp
	src/Filesystem.cpp src/DOMNode.cpp src/DOMText.cpp src/DOMElement.cpp src/DOMXPathResult.cpp
	src/DOMDocument.cpp src/DOMNamedNodeMap.cpp src/XPathTokens.cpp src/XPathParser.cpp src/XPathEval.cpp
	src/XPathOperators.cpp src/XPathFunctions.cpp src/DOMXPath.cpp src/WorkflowXPathFunctions.cpp
	src/ExceptionManager.cpp src/ExceptionWorkflowContext.cpp src/XMLString.cpp src/Datastore.cpp
	src/XMLFormatter.cpp src/UniqueAction.cpp)

if(USELIBGIT2)
	add_definitions(-DUSELIBGIT2)
	target_link_libraries(evqueue git2)
	Message("Git support is enabled")
endif(USELIBGIT2)

if(USESTATICLIBGIT2)
	add_definitions(-DUSELIBGIT2)
	target_link_libraries(evqueue libgit2.a)
	target_link_libraries(evqueue ssh2)
	target_link_libraries(evqueue http_parser)
	target_link_libraries(evqueue curl)
	target_link_libraries(evqueue ssl)
	target_link_libraries(evqueue crypto)
	target_link_libraries(evqueue rt)
	Message("Git static support is enabled")
endif(USESTATICLIBGIT2)

include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
    message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
endif()

include_directories(include /usr/include)

target_link_libraries(evqueue z)
target_link_libraries(evqueue mysqlclient)
target_link_libraries(evqueue pthread)
target_link_libraries(evqueue xerces-c)
target_link_libraries(evqueue pcrecpp)



project(evqueue_monitor)

add_executable(evqueue_monitor src/evqueue_monitor.cpp src/tools_ipc.cpp src/tools_env.cpp)

include_directories(src/include /usr/include)



project(evqueue_notification_monitor)

add_executable(evqueue_notification_monitor src/evqueue_notification_monitor.cpp src/tools_ipc.cpp)

include_directories(src/include /usr/include)



project(evqueue_wfmanager)

add_executable(evqueue_wfmanager
	src/evqueue_wfmanager.cpp src/ClientBase.cpp src/Exception.cpp src/ExceptionManager.cpp src/SocketResponseSAX2Handler.cpp src/SocketSAX2Handler.cpp
	src/NetworkInputSource.cpp src/BinNetworkInputStream.cpp src/hmac.cpp src/sha1.c src/Sha1String.cpp src/XMLString.cpp src/DOMDocument.cpp src/DOMElement.cpp src/DOMNode.cpp src/DOMText.cpp
	src/DOMXPath.cpp src/DOMXPathResult.cpp src/XPathTokens.cpp src/XPathEval.cpp src/XPathOperators.cpp
	src/XPathFunctions.cpp src/DOMNamedNodeMap.cpp src/XPathEval.cpp src/XPathParser.cpp)

include_directories(src/include /usr/include)

target_link_libraries(evqueue_wfmanager xerces-c)
target_link_libraries(evqueue_wfmanager pcrecpp)



project(evqueue_api)

add_executable(evqueue_api
	src/evqueue_api.cpp src/ClientBase.cpp src/Exception.cpp src/ExceptionManager.cpp src/SocketResponseSAX2Handler.cpp src/SocketSAX2Handler.cpp
	src/NetworkInputSource.cpp src/BinNetworkInputStream.cpp src/hmac.cpp src/sha1.c src/XMLFormatter.cpp
	src/Sha1String.cpp src/XMLString.cpp src/DOMDocument.cpp src/DOMElement.cpp src/DOMNode.cpp src/DOMText.cpp
	src/DOMXPath.cpp src/DOMXPathResult.cpp src/XPathTokens.cpp src/XPathEval.cpp src/XPathOperators.cpp
	src/XPathFunctions.cpp src/DOMNamedNodeMap.cpp src/XPathEval.cpp src/XPathParser.cpp)

include_directories(src/include /usr/include)

target_link_libraries(evqueue_api xerces-c)
target_link_libraries(evqueue_api pcrecpp)



project(evqueue_agent)

add_executable(evqueue_agent src/evqueue_agent.cpp src/tools_env.cpp)

include_directories(src/include /usr/include)



ADD_CUSTOM_TARGET(man ALL)
ADD_CUSTOM_COMMAND(
  TARGET man
  COMMAND gzip -9n ${CMAKE_CURRENT_SOURCE_DIR}/src/evqueue.8 --stdout >${CMAKE_CURRENT_BINARY_DIR}/evqueue.8.gz
)

ADD_CUSTOM_COMMAND(
  TARGET man
  COMMAND gzip -9n ${CMAKE_CURRENT_SOURCE_DIR}/src/evqueue_wfmanager.8 --stdout >${CMAKE_CURRENT_BINARY_DIR}/evqueue_wfmanager.8.gz
)

ADD_CUSTOM_COMMAND(
  TARGET man
  COMMAND gzip -9n ${CMAKE_CURRENT_SOURCE_DIR}/src/evqueue_api.8 --stdout >${CMAKE_CURRENT_BINARY_DIR}/evqueue_api.8.gz
)

ADD_CUSTOM_COMMAND(
  TARGET man
  COMMAND gzip -9n ${CMAKE_CURRENT_SOURCE_DIR}/src/evqueue_agent.8 --stdout >${CMAKE_CURRENT_BINARY_DIR}/evqueue_agent.8.gz
)



install(TARGETS evqueue evqueue_monitor evqueue_notification_monitor DESTINATION bin COMPONENT core)
install(FILES debian/etc/evqueue.conf DESTINATION /etc COMPONENT core)
install(FILES debian/etc/rsyslog.d/90-evqueue.conf DESTINATION /etc/rsyslog.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ COMPONENT core)
install(DIRECTORY src/plugins DESTINATION /usr/share/evqueue-core DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_WRITE GROUP_READ WORLD_EXECUTE WORLD_READ COMPONENT core)
install(DIRECTORY src/plugins/notifications DESTINATION /usr/share/evqueue-core/plugins DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_WRITE GROUP_READ WORLD_EXECUTE WORLD_READ COMPONENT core)
install(DIRECTORY DESTINATION /usr/share/evqueue-core/tasks COMPONENT core)
install(DIRECTORY debian/usr/share/doc/evqueue DESTINATION /usr/share/doc DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ COMPONENT core)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/evqueue.8.gz DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man8 COMPONENT core)

install(TARGETS evqueue_wfmanager evqueue_api DESTINATION bin COMPONENT utils)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/evqueue_wfmanager.8.gz DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man8 COMPONENT utils)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/evqueue_api.8.gz DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man8 COMPONENT utils)

install(TARGETS evqueue_agent DESTINATION bin COMPONENT agent)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/evqueue_agent.8.gz DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man8 COMPONENT agent)