1 #need to update cmake version here
2 cmake_minimum_required(VERSION 3.14.0)
5 option(USE_SQLITE "Enable SQLITE DB" ON)
7 set (CMAKE_INCLUDE_DIR ${CMAKE_INCLUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/common")
15 list(APPEND dbstore_srcs
27 add_library(dbstore_lib ${dbstore_srcs})
28 target_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}")
32 set(link_targets spawn)
34 list(APPEND link_targets jaeger_base)
36 list(APPEND link_targets rgw_common)
37 target_link_libraries(dbstore_lib PUBLIC ${link_targets})
39 set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} dbstore_lib)
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)
51 set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} pthread)
53 find_package(gtest QUIET)
55 add_subdirectory(tests)
57 message(WARNING "Gtest not enabled")
60 include_directories(${CMAKE_INCLUDE_DIR})
61 add_library(dbstore STATIC ${dbstore_mgr_srcs})
62 target_link_libraries(dbstore ${CMAKE_LINK_LIBRARIES})
68 set (CMAKE_LINK_LIBRARIES ${CMAKE_LINK_LIBRARIES} dbstore)
69 add_executable(dbstore-bin ${dbstore_main_srcs})
70 add_dependencies(dbstore-bin dbstore)
71 target_link_libraries(dbstore-bin ${CMAKE_LINK_LIBRARIES})