diff options
author | aneejit1 <[email protected]> | 2020-06-25 12:54:05 +0000 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2020-06-26 14:59:49 +0900 |
commit | 082c64530f2130a935d6bcb1cb03d3abbaf28170 (patch) | |
tree | b6b9899809620759891e11e05f7fa5eab5b4b538 /ConfigureChecks.cmake | |
parent | 64064b2080e5115c80b345864ad893215a0c7e23 (diff) | |
download | amarok-082c64530f2130a935d6bcb1cb03d3abbaf28170.tar.gz amarok-082c64530f2130a935d6bcb1cb03d3abbaf28170.zip |
Ask pkg-config about PostgreSQL/add library path to link_directories
Signed-off-by: aneejit1 <[email protected]>
(cherry picked from commit 226d54f648a6fe9ab1d9815cfe3ebc90a7a19e5b)
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index cfee3236..44ea0682 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -344,15 +344,26 @@ endif( WITH_MYSQL ) if( WITH_POSTGRESQL ) ##### check for PostgreSQL -message( STATUS "Check for PostgreSQL" ) -find_package( PostgreSQL ) -if( PostgreSQL_INCLUDE_DIR AND PostgreSQL_LIBRARY ) + message( STATUS "Check for PostgreSQL" ) + find_package( PostgreSQL ) + + if( PostgreSQL_INCLUDE_DIR AND PostgreSQL_LIBRARY ) message( STATUS " includes ${PostgreSQL_INCLUDE_DIR} ") message( STATUS " library ${PostgreSQL_LIBRARY} ") set( USE_POSTGRESQL 1 ) else() - tde_message_fatal( "Postgresql support is requested but Postgresql was not found on your system." ) -endif() + pkg_search_module( LIBPQ libpq ) + + if( NOT LIBPQ_FOUND ) + tde_message_fatal( "Postgresql support is requested but Postgresql was not found on your system." ) + endif() + + set( PostgreSQL_INCLUDE_DIR "${LIBPQ_INCLUDE_DIRS}" ) + set( PostgreSQL_LIBRARY "${LIBPQ_LIBRARIES}" ) + set( PostgreSQL_LIBRARY_DIRS "${LIBPQ_LIBRARY_DIRS}" ) + set( USE_POSTGRESQL 1 ) + endif() + endif( WITH_POSTGRESQL ) |