CMakeLists.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Tests for smartbotic-database
  2. # Vector storage integration test
  3. # Compiles memory_store.cpp directly — no dependency on the full service executable.
  4. set(TEST_VECTOR_SOURCES
  5. test_vector_storage.cpp
  6. ${CMAKE_CURRENT_SOURCE_DIR}/../service/src/memory_store.cpp
  7. )
  8. add_executable(test_vector_storage ${TEST_VECTOR_SOURCES})
  9. target_include_directories(test_vector_storage PRIVATE
  10. ${CMAKE_CURRENT_SOURCE_DIR}/../service/src
  11. )
  12. # nlohmann/json
  13. if(TARGET nlohmann_json::nlohmann_json)
  14. target_link_libraries(test_vector_storage PRIVATE nlohmann_json::nlohmann_json)
  15. else()
  16. target_include_directories(test_vector_storage PRIVATE ${NLOHMANN_JSON_INCLUDE_DIRS})
  17. endif()
  18. # spdlog
  19. if(TARGET spdlog::spdlog)
  20. target_link_libraries(test_vector_storage PRIVATE spdlog::spdlog)
  21. else()
  22. target_link_libraries(test_vector_storage PRIVATE ${SPDLOG_LIBRARIES})
  23. target_include_directories(test_vector_storage PRIVATE ${SPDLOG_INCLUDE_DIRS})
  24. endif()
  25. # Threads (required by MemoryStore background threads)
  26. find_package(Threads REQUIRED)
  27. target_link_libraries(test_vector_storage PRIVATE Threads::Threads)
  28. # Register with CTest
  29. enable_testing()
  30. add_test(NAME vector_storage COMMAND test_vector_storage)