CMakeLists.txt 843 B

123456789101112131415161718192021222324
  1. cmake_minimum_required(VERSION 3.15)
  2. project(tsdb CXX)
  3. set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
  4. find_package(clickhouse-cpp REQUIRED)
  5. find_package(spdlog REQUIRED)
  6. find_package(yaml-cpp REQUIRED)
  7. find_package(nlohmann_json REQUIRED)
  8. find_package(fmt REQUIRED)
  9. find_package(zstd REQUIRED)
  10. add_library(tsdb src/tsdb.cpp src/tsdb_hf.cpp)
  11. target_include_directories(tsdb PUBLIC include)
  12. set_target_properties(tsdb PROPERTIES PUBLIC_HEADER "include/tsdb.h;include/tsdb_hf.h")
  13. target_link_libraries(tsdb PRIVATE clickhouse-cpp-lib::clickhouse-cpp-lib)
  14. target_link_libraries(tsdb PRIVATE spdlog::spdlog)
  15. target_link_libraries(tsdb PRIVATE yaml-cpp::yaml-cpp)
  16. target_link_libraries(tsdb PRIVATE nlohmann_json::nlohmann_json)
  17. target_link_libraries(tsdb PRIVATE fmt::fmt)
  18. target_link_libraries(tsdb PRIVATE zstd::libzstd_static)
  19. install(TARGETS tsdb)