1 add_custom_target(civetweb_h
2 COMMAND ${CMAKE_COMMAND} -E make_directory
3 "${CMAKE_BINARY_DIR}/src/include/civetweb"
4 COMMAND ${CMAKE_COMMAND} -E copy_if_different
5 "${CMAKE_SOURCE_DIR}/src/civetweb/include/civetweb.h"
6 "${CMAKE_BINARY_DIR}/src/include/civetweb"
7 COMMENT "keep civetweb.h up-to-date")
9 find_program(GPERF gperf)
11 message(FATAL_ERROR "Can't find gperf")
13 function(gperf_generate input output)
16 COMMAND ${GPERF} ${input} | sed "s/register //g" > ${output}
18 COMMENT "Generate ${output}"
22 set(librgw_common_srcs
23 services/svc_finisher.cc
24 services/svc_notify.cc
26 services/svc_sync_modules.cc
28 services/svc_sys_obj.cc
29 services/svc_sys_obj_cache.cc
30 services/svc_sys_obj_core.cc
32 services/svc_zone_utils.cc
67 rgw_sync_module_aws.cc
69 rgw_sync_module_es_rest.cc
70 rgw_sync_module_log.cc
71 rgw_sync_module_pubsub.cc
74 rgw_notify_event_type.cc
75 rgw_sync_module_pubsub_rest.cc
85 rgw_object_expirer_core.cc
90 rgw_putobj_processor.cc
100 rgw_rest_pubsub_common.cc
115 rgw_crypt_sanitize.cc
117 rgw_rest_user_policy.cc
124 if(WITH_RADOSGW_AMQP_ENDPOINT)
125 list(APPEND librgw_common_srcs rgw_amqp.cc)
128 add_library(rgw_common OBJECT ${librgw_common_srcs})
130 target_include_directories(rgw_common SYSTEM PUBLIC "services")
131 target_include_directories(rgw_common PUBLIC "${CMAKE_SOURCE_DIR}/src/dmclock/support/src")
134 # rgw/rgw_op.cc includes "tracing/rgw_op.h"
135 # rgw/rgw_rados.cc includes "tracing/rgw_rados.h"
136 add_dependencies(rgw_common rgw_op-tp rgw_rados-tp)
143 rgw_http_client_curl.cc
147 rgw_realm_reloader.cc
165 gperf_generate(${CMAKE_SOURCE_DIR}/src/rgw/rgw_iam_policy_keywords.gperf
166 rgw_iam_policy_keywords.frag.cc)
167 set_source_files_properties(rgw_iam_policy.cc PROPERTIES
168 OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/src/rgw/rgw_iam_policy_keywords.frag.cc
169 COMPILE_FLAGS -I${CMAKE_BINARY_DIR}/src/rgw)
172 if (WITH_RADOSGW_FCGI_FRONTEND)
173 list(APPEND rgw_a_srcs rgw_fcgi.cc)
176 add_library(rgw_a STATIC
178 $<TARGET_OBJECTS:rgw_common>)
180 add_dependencies(rgw_a civetweb_h)
182 target_include_directories(rgw_a PUBLIC "${CMAKE_SOURCE_DIR}/src/dmclock/support/src")
183 target_include_directories(rgw_a SYSTEM PUBLIC "../rapidjson/include")
185 if(WITH_RADOSGW_AMQP_ENDPOINT)
186 find_package(RabbitMQ REQUIRED)
189 target_link_libraries(rgw_a
191 librados cls_otp_client cls_lock_client cls_rgw_client cls_refcount_client
192 cls_log_client cls_timeindex_client cls_version_client
193 cls_user_client ceph-common common_utf8 global
196 ${OPENLDAP_LIBRARIES} ${CRYPTO_LIBS}
199 if(WITH_CURL_OPENSSL)
200 # used by rgw_http_client_curl.cc
201 target_link_libraries(rgw_a PRIVATE OpenSSL::Crypto)
204 if(WITH_BOOST_CONTEXT)
205 target_link_libraries(rgw_a PRIVATE Boost::coroutine Boost::context)
209 if(WITH_RADOSGW_AMQP_ENDPOINT)
210 # used by rgw_amqp.cc
211 list(APPEND rgw_libs RabbitMQ::RabbitMQ)
215 rgw_loadgen_process.cc
217 rgw_civetweb_frontend.cc
219 rgw_dmclock_scheduler_ctx.cc
220 rgw_dmclock_sync_scheduler.cc)
222 if (WITH_RADOSGW_FCGI_FRONTEND)
223 list(APPEND radosgw_srcs rgw_fcgi_process.cc)
226 if(WITH_RADOSGW_BEAST_FRONTEND)
227 list(APPEND radosgw_srcs
230 rgw_dmclock_async_scheduler.cc)
233 add_library(radosgw_a STATIC ${radosgw_srcs}
234 $<TARGET_OBJECTS:civetweb_common_objs>)
235 target_link_libraries(radosgw_a PRIVATE ${rgw_libs})
236 if(WITH_RADOSGW_BEAST_FRONTEND AND WITH_RADOSGW_BEAST_OPENSSL)
237 # used by rgw_asio_frontend.cc
238 target_link_libraries(radosgw_a PRIVATE OpenSSL::SSL)
241 add_executable(radosgw rgw_main.cc)
242 target_link_libraries(radosgw radosgw_a librados
243 cls_rgw_client cls_otp_client cls_lock_client cls_refcount_client
244 cls_log_client cls_timeindex_client
245 cls_version_client cls_user_client
246 global dmclock::dmclock
247 ${FCGI_LIBRARY} ${LIB_RESOLV}
248 ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${BLKID_LIBRARIES}
250 install(TARGETS radosgw DESTINATION bin)
252 set(radosgw_admin_srcs
255 add_executable(radosgw-admin ${radosgw_admin_srcs})
256 target_link_libraries(radosgw-admin ${rgw_libs} librados
257 cls_rgw_client cls_otp_client cls_lock_client cls_refcount_client
258 cls_log_client cls_timeindex_client
259 cls_version_client cls_user_client
260 global ${FCGI_LIBRARY} ${LIB_RESOLV}
261 ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${BLKID_LIBRARIES})
262 install(TARGETS radosgw-admin DESTINATION bin)
266 add_executable(radosgw-es ${radosgw_es_srcs})
267 target_link_libraries(radosgw-es ${rgw_libs} librados
268 cls_rgw_client cls_otp_client cls_lock_client cls_refcount_client
269 cls_log_client cls_timeindex_client
270 cls_version_client cls_user_client
271 global ${FCGI_LIBRARY} ${LIB_RESOLV}
272 ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${BLKID_LIBRARIES})
273 install(TARGETS radosgw-es DESTINATION bin)
275 set(radosgw_token_srcs
277 add_executable(radosgw-token ${radosgw_token_srcs})
278 target_link_libraries(radosgw-token librados
279 global ${ALLOC_LIBS})
280 install(TARGETS radosgw-token DESTINATION bin)
282 set(radosgw_object_expirer_srcs
283 rgw_object_expirer.cc)
284 add_executable(radosgw-object-expirer ${radosgw_object_expirer_srcs})
285 target_link_libraries(radosgw-object-expirer ${rgw_libs} librados
286 cls_rgw_client cls_otp_client cls_lock_client cls_refcount_client
287 cls_log_client cls_timeindex_client
288 cls_version_client cls_user_client
289 global ${FCGI_LIBRARY} ${LIB_RESOLV}
290 ${CURL_LIBRARIES} ${EXPAT_LIBRARIES})
291 install(TARGETS radosgw-object-expirer DESTINATION bin)
296 add_library(rgw SHARED ${librgw_srcs})
297 target_link_libraries(rgw
316 if(WITH_RADOSGW_AMQP_ENDPOINT)
317 target_link_libraries(rgw PRIVATE RabbitMQ::RabbitMQ)
320 set_target_properties(rgw PROPERTIES OUTPUT_NAME rgw VERSION 2.0.0
322 install(TARGETS rgw DESTINATION ${CMAKE_INSTALL_LIBDIR})
324 set(librgw_admin_user_srcs
328 add_library(rgw_admin_user SHARED
329 ${librgw_admin_user_srcs}
330 $<TARGET_OBJECTS:rgw_common>)
332 add_dependencies(rgw_admin_user civetweb_h)
334 target_link_libraries(rgw_admin_user PRIVATE
347 ${OPENLDAP_LIBRARIES}
349 set_target_properties(rgw_admin_user PROPERTIES OUTPUT_NAME rgw_admin_user VERSION 1.0.0
351 install(TARGETS rgw_admin_user DESTINATION ${CMAKE_INSTALL_LIBDIR})
352 if(WITH_RADOSGW_AMQP_ENDPOINT)
353 target_link_libraries(rgw_admin_user PRIVATE RabbitMQ::RabbitMQ)
355 if(WITH_BOOST_CONTEXT)
356 target_link_libraries(rgw_admin_user PRIVATE Boost::coroutine Boost::context)
360 add_executable(ceph_rgw_jsonparser
362 target_link_libraries(ceph_rgw_jsonparser
366 add_executable(ceph_rgw_multiparser
368 target_link_libraries(ceph_rgw_multiparser