Skip to content

Commit

Permalink
fix reporting of postgres version
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Feb 20, 2025
1 parent 055e0c9 commit efb059a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
8 changes: 0 additions & 8 deletions cmake/FindPostgres.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ if(${PostgreSQL_FOUND})
set(POSTGRES_INCLUDE_DIR ${PostgreSQL_INCLUDE_DIRS})
set(POSTGRES_LIBRARY ${PostgreSQL_LIBRARIES})
set(POSTGRES_FOUND TRUE)
if(EXISTS "${POSTGRES_INCLUDE_DIR}/pg_config.h")
set(HAVE_PGCONFIG TRUE)
endif()
return()
endif()

Expand Down Expand Up @@ -118,11 +115,6 @@ ENDIF(WIN32 AND NOT ANDROID)

IF (POSTGRES_INCLUDE_DIR AND POSTGRES_LIBRARY)
SET(POSTGRES_FOUND TRUE)
IF(EXISTS "${POSTGRES_INCLUDE_DIR}/pg_config.h")
SET(HAVE_PGCONFIG TRUE)
ELSE(EXISTS "${POSTGRES_INCLUDE_DIR}/pg_config.h")
SET(HAVE_PGCONFIG FALSE)
ENDIF(EXISTS "${POSTGRES_INCLUDE_DIR}/pg_config.h")
ENDIF (POSTGRES_INCLUDE_DIR AND POSTGRES_LIBRARY)


Expand Down
2 changes: 1 addition & 1 deletion src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ target_compile_features(qgis_app PRIVATE cxx_std_17)

target_compile_definitions(qgis_app PRIVATE "QT_PLUGINS_DIR=\"${QT_PLUGINS_DIR}\"")
if (POSTGRES_FOUND)
target_compile_definitions(qgis_app PRIVATE -DPOSTGRESQL_VERSION=${PostgreSQL_VERSION_STRING})
target_compile_definitions(qgis_app PRIVATE -DPOSTGRESQL_VERSION=\"${PostgreSQL_VERSION_STRING}\")
endif()

target_include_directories(qgis_app PUBLIC
Expand Down
14 changes: 2 additions & 12 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,20 +538,10 @@

// Editor widgets
#include "qgseditorwidgetregistry.h"

//
// Conditional Includes
//
#ifdef HAVE_PGCONFIG
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#include <pg_config.h>
#else
#define PG_VERSION "unknown"
#endif

#include <sqlite3.h>

#ifdef HAVE_SPATIALITE
Expand Down Expand Up @@ -5579,7 +5569,7 @@ QString QgisApp::getVersionString()
// postgres
versionString += QStringLiteral( "<td>%1</td><td>" ).arg( tr( "PostgreSQL client version" ) );
#ifdef HAVE_POSTGRESQL
versionString += QStringLiteral( PG_VERSION );
versionString += QStringLiteral( POSTGRESQL_VERSION );
#else
versionString += tr( "No support" );
#endif
Expand Down

0 comments on commit efb059a

Please sign in to comment.