Fixed PostgreSQL CMake dependencies

This commit is contained in:
stephb9959
2021-03-08 09:02:40 -08:00
parent 92fac970d4
commit 04a61e9338
2 changed files with 4 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ set_target_properties(DataPostgreSQL
DEFINE_SYMBOL PostgreSQL_EXPORTS
)
target_link_libraries(DataPostgreSQL PUBLIC Poco::Data PostgreSQL::client)
target_link_libraries(DataPostgreSQL PUBLIC Poco::Data PostgreSQL::PostgreSQL)
target_include_directories(DataPostgreSQL
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>

View File

@@ -201,9 +201,9 @@ if(PostgreSQL_FOUND)
set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY})
endif()
if(PostgreSQL_FOUND AND NOT TARGET PostgreSQL::client)
add_library(PostgreSQL::client UNKNOWN IMPORTED)
set_target_properties(PostgreSQL::client PROPERTIES
if(PostgreSQL_FOUND AND NOT TARGET PostgreSQL::PostgreSQL)
add_library(PostgreSQL::PostgreSQL UNKNOWN IMPORTED)
set_target_properties(PostgreSQL::PostgreSQL PROPERTIES
IMPORTED_LOCATION "${PostgreSQL_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${PostgreSQL_INCLUDE_DIR}"
)