Advertisement
kolbka_

Untitled

May 13th, 2023
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.22)
  2.  
  3. project(yandex_test_task)
  4.  
  5.  
  6. set(CMAKE_CXX_STANDARD 17)
  7.  
  8. include_directories(.)
  9. include_directories(src)
  10. include_directories(src/adapters)
  11. include_directories(src/adapters/repository)
  12.  
  13. set(PostgreSQL_LIBRARY "/opt/homebrew/Cellar/postgresql@14/14.7/lib/postgresql@14/")
  14. set(PostgreSQL_INCLUDE_DIR "/opt/homebrew/Cellar/postgresql@14/14.7/include/postgresql@14/")
  15. set(PQXX "/opt/homebrew/Cellar/libpqxx/7.7.5/include/pqxx/")
  16.  
  17. find_package(Boost)
  18. if (Boost_FOUND)
  19. include_directories(${Boost_INCLUDE_DIR})
  20. endif ()
  21.  
  22. find_package(PostgreSQL REQUIRED)
  23. find_library(PQXX_LIB pqxx)
  24.  
  25. add_executable(service
  26. src/main.cpp
  27. src/adapters/repository/Repository.cpp
  28. src/service/Service.cpp)
  29.  
  30.  
  31. # This line adds both include paths and libraries for Postgres
  32. target_link_libraries(service PRIVATE ${PostgreSQL} ${PQXX_LIB})
  33.  
  34. set_target_properties(PostgreSQL::PostgreSQL PROPERTIES IMPORTED_LOCATION_DEBUG "${PostgreSQL_LIBRARY}/libpq.dylib")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement