Ask pkg-config about PostgreSQL/add library path to link_directories

Signed-off-by: aneejit1 <aneejit1@gmail.com>
pull/21/head
aneejit1 2 years ago committed by TDE Gitea
parent b295bce331
commit 226d54f648
  1. 21
      ConfigureChecks.cmake
  2. 1
      amarok/src/CMakeLists.txt

@ -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 )

@ -49,6 +49,7 @@ include_directories(
link_directories(
${TQT_LIBRARY_DIRS}
${PostgreSQL_LIBRARY_DIRS}
)

Loading…
Cancel
Save