CMakeLists.txt 924 B

12345678910111213141516171819202122232425262728293031
  1. # Smartbotic Database Client Library
  2. add_library(smartbotic-db-client STATIC
  3. src/client.cpp
  4. )
  5. target_include_directories(smartbotic-db-client PUBLIC
  6. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  7. $<INSTALL_INTERFACE:include>
  8. )
  9. # Link dependencies
  10. target_link_libraries(smartbotic-db-client PUBLIC
  11. smartbotic_db_proto
  12. )
  13. if(TARGET nlohmann_json::nlohmann_json)
  14. target_link_libraries(smartbotic-db-client PUBLIC nlohmann_json::nlohmann_json)
  15. else()
  16. target_include_directories(smartbotic-db-client PUBLIC ${NLOHMANN_JSON_INCLUDE_DIRS})
  17. endif()
  18. if(TARGET spdlog::spdlog)
  19. target_link_libraries(smartbotic-db-client PUBLIC spdlog::spdlog)
  20. else()
  21. target_link_libraries(smartbotic-db-client PUBLIC ${SPDLOG_LIBRARIES})
  22. target_include_directories(smartbotic-db-client PUBLIC ${SPDLOG_INCLUDE_DIRS})
  23. endif()
  24. # Export alias
  25. add_library(smartbotic::db-client ALIAS smartbotic-db-client)