diff --git a/postgresql/CMakeLists.txt b/postgresql/CMakeLists.txt index 7f8d86b5b0be..6f31ea25ce74 100644 --- a/postgresql/CMakeLists.txt +++ b/postgresql/CMakeLists.txt @@ -12,8 +12,12 @@ else() PROPERTIES COMPILE_FLAGS -DUSERVER_NO_LIBPQ_PATCHES=1 ) - find_library(PostgreSQL_LIBRARY NAMES libpq.so libpq.dylib REQUIRED) - find_package(PostgreSQL REQUIRED) + if(USERVER_CONAN) + find_package(PostgreSQL REQUIRED CONFIG) + else() + find_library(PostgreSQL_LIBRARY NAMES libpq.so libpq.dylib REQUIRED) + find_package(PostgreSQL REQUIRED) + endif() target_link_libraries(userver-libpq INTERFACE PostgreSQL::PostgreSQL) endif()