Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cmake_minimum_required(VERSION 3.22)
- project(yandex_test_task)
- set(CMAKE_CXX_STANDARD 17)
- include_directories(.)
- include_directories(src)
- include_directories(src/adapters)
- include_directories(src/adapters/repository)
- set(PostgreSQL_LIBRARY "/opt/homebrew/Cellar/postgresql@14/14.7/lib/postgresql@14/")
- set(PostgreSQL_INCLUDE_DIR "/opt/homebrew/Cellar/postgresql@14/14.7/include/postgresql@14/")
- set(PQXX "/opt/homebrew/Cellar/libpqxx/7.7.5/include/pqxx/")
- find_package(Boost)
- if (Boost_FOUND)
- include_directories(${Boost_INCLUDE_DIR})
- endif ()
- find_package(PostgreSQL REQUIRED)
- find_library(PQXX_LIB pqxx)
- add_executable(service
- src/main.cpp
- src/adapters/repository/Repository.cpp
- src/service/Service.cpp)
- # This line adds both include paths and libraries for Postgres
- target_link_libraries(service PRIVATE ${PostgreSQL} ${PQXX_LIB})
- set_target_properties(PostgreSQL::PostgreSQL PROPERTIES IMPORTED_LOCATION_DEBUG "${PostgreSQL_LIBRARY}/libpq.dylib")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement