]> git.proxmox.com Git - ceph.git/blame - ceph/src/rgw/driver/dbstore/CMakeLists.txt
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rgw / driver / dbstore / CMakeLists.txt
CommitLineData
20effc67
TL
1#need to update cmake version here
2cmake_minimum_required(VERSION 3.14.0)
3project(dbstore)
4
5option(USE_SQLITE "Enable SQLITE DB" ON)
6
7set (CMAKE_INCLUDE_DIR ${CMAKE_INCLUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/common")
8
9set(dbstore_srcs
10 common/dbstore_log.h
11 common/dbstore.h
1e59de90
TL
12 common/dbstore.cc
13 config/store.cc)
14IF(USE_SQLITE)
15 list(APPEND dbstore_srcs
16 config/sqlite.cc
17 sqlite/connection.cc
18 sqlite/error.cc
19 sqlite/statement.cc)
20endif()
20effc67
TL
21
22set(dbstore_mgr_srcs
23 dbstore_mgr.h
24 dbstore_mgr.cc
25 )
26
27add_library(dbstore_lib ${dbstore_srcs})
1e59de90
TL
28target_include_directories(dbstore_lib
29 PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw"
30 PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw/store/rados"
31 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
20effc67
TL
32set(link_targets spawn)
33if(WITH_JAEGER)
1e59de90 34 list(APPEND link_targets jaeger_base)
20effc67 35endif()
2a845540 36list(APPEND link_targets rgw_common)
20effc67
TL
37target_link_libraries(dbstore_lib PUBLIC ${link_targets})
38
39set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} dbstore_lib)
40
41IF(USE_SQLITE)
42 add_subdirectory(sqlite)
43 set(CMAKE_INCLUDE_DIR ${CMAKE_INCLUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/sqlite")
44 add_compile_definitions(SQLITE_ENABLED=1)
45 set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} rgw_common)
46 set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} sqlite_db)
47 add_dependencies(sqlite_db dbstore_lib)
48ENDIF()
49
50# add pthread library
51set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} pthread)
52
53find_package(gtest QUIET)
54if(WITH_TESTS)
55 add_subdirectory(tests)
56else()
57 message(WARNING "Gtest not enabled")
58endif()
59
60include_directories(${CMAKE_INCLUDE_DIR})
1e59de90 61add_library(dbstore STATIC ${dbstore_mgr_srcs})
20effc67
TL
62target_link_libraries(dbstore ${CMAKE_LINK_LIBRARIES})
63
64# testing purpose
65set(dbstore_main_srcs
66 dbstore_main.cc)
67
68set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} dbstore)
69add_executable(dbstore-bin ${dbstore_main_srcs})
70add_dependencies(dbstore-bin dbstore)
71target_link_libraries(dbstore-bin ${CMAKE_LINK_LIBRARIES})