Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix reporting of postgres version #60676

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading