Verified Commit 0399fb40 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

cmake: use rocksDB as imported target

parent 5fd8d18e
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -113,6 +113,33 @@ if (NOT USE_OFI_VERBS AND NOT USE_OFI_PSM2 AND NOT USE_CCI AND NOT USE_BMI)
    add_definitions(-DRPC_PROTOCOL="bmi+tcp")
endif()


# Imported target
add_library(RocksDB INTERFACE IMPORTED GLOBAL)
target_link_libraries(RocksDB
    INTERFACE
    ${ROCKSDB_LIBRARIES}
    # rocksdb libs
    ${snappy_LIBRARIES}
    ${ZLIB_LIBRARIES}
    ${BZIP2_LIBRARIES}
    ${ZSTD_LIBRARIES}
    ${LZ4_LIBRARY}
)

if(${JeMalloc_FOUND})
    target_link_libraries(RocksDB
        INTERFACE
        ${JEMALLOC_LIBRARIES}
    )
endif()
# we cannot use target_include_directories with CMake < 3.11
set_target_properties(RocksDB
    PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES ${ROCKSDB_INCLUDE_DIRS}
)


set(INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include")

# define include directories that are relevant for all targets
+1 −1
Original line number Diff line number Diff line
@@ -40,9 +40,9 @@ target_link_libraries(adafs_daemon
    ${ABT_SNOOZER_LIBRARIES}
    mercury
    ${MARGO_LIBRARIES}
    # others
    Boost::program_options
    Boost::filesystem
    ${JEMALLOC_LIBRARIES}
    Threads::Threads
    )

+2 −14
Original line number Diff line number Diff line
@@ -12,17 +12,5 @@ target_sources(metadata_db
    )

target_link_libraries(metadata_db
    ${ROCKSDB_LIBRARIES}
    # rocksdb libs
    ${snappy_LIBRARIES}
    ${ZLIB_LIBRARIES}
    ${BZIP2_LIBRARIES}
    ${ZSTD_LIBRARIES}
    ${LZ4_LIBRARY}
    ${JEMALLOC_LIBRARIES}
    )

target_include_directories(metadata_db
    PRIVATE
    ${ROCKSDB_INCLUDE_DIRS}
    RocksDB
)