CMakeLists.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Web server - smartbotic-server binary
  2. # Create library for webserver components
  3. add_library(smartbotic_webserver STATIC
  4. src/config.cpp
  5. src/http_server.cpp
  6. src/database_client.cpp
  7. )
  8. target_include_directories(smartbotic_webserver
  9. PUBLIC
  10. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  11. $<INSTALL_INTERFACE:include>
  12. )
  13. target_compile_options(smartbotic_webserver PRIVATE ${SMARTBOTIC_CXX_WARNINGS})
  14. target_link_libraries(smartbotic_webserver
  15. PUBLIC
  16. smartbotic::common
  17. smartbotic::proto
  18. spdlog::spdlog
  19. nlohmann_json::nlohmann_json
  20. yaml-cpp::yaml-cpp
  21. Boost::beast
  22. Boost::asio
  23. )
  24. add_library(smartbotic::webserver ALIAS smartbotic_webserver)
  25. # Create the executable
  26. add_executable(smartbotic-server
  27. src/main.cpp
  28. )
  29. target_include_directories(smartbotic-server
  30. PRIVATE
  31. ${CMAKE_CURRENT_SOURCE_DIR}/include
  32. )
  33. target_compile_options(smartbotic-server PRIVATE ${SMARTBOTIC_CXX_WARNINGS})
  34. target_link_libraries(smartbotic-server
  35. PRIVATE
  36. smartbotic::webserver
  37. smartbotic::common
  38. smartbotic::proto
  39. spdlog::spdlog
  40. nlohmann_json::nlohmann_json
  41. sodium
  42. )