summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraneejit1 <aneejit1@gmail.com>2020-06-25 12:54:05 +0000
committerTDE Gitea <gitea@mirror.git.trinitydesktop.org>2020-06-26 05:57:21 +0000
commit226d54f648a6fe9ab1d9815cfe3ebc90a7a19e5b (patch)
treee83671a759046de9a4c700d2013134062dbe8ccb
parentb295bce331f1f4936e8564f4b8be3812d854b2ee (diff)
downloadamarok-226d54f6.tar.gz
amarok-226d54f6.zip
Ask pkg-config about PostgreSQL/add library path to link_directories
Signed-off-by: aneejit1 <aneejit1@gmail.com>
-rw-r--r--ConfigureChecks.cmake21
-rw-r--r--amarok/src/CMakeLists.txt1
2 files changed, 17 insertions, 5 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 5afc1c2..d151dd6 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 )
diff --git a/amarok/src/CMakeLists.txt b/amarok/src/CMakeLists.txt
index b684d94..07fb0e9 100644
--- a/amarok/src/CMakeLists.txt
+++ b/amarok/src/CMakeLists.txt
@@ -49,6 +49,7 @@ include_directories(
link_directories(
${TQT_LIBRARY_DIRS}
+ ${PostgreSQL_LIBRARY_DIRS}
)