22 #include "qgsversion.h"
26 #include <gdal_version.h>
34 QString versionString = QStringLiteral(
"QGIS %1 '%2' (%3)\n" ).arg( VERSION, RELEASE_NAME, QGSVERSION );
39 versionString += QLatin1String(
"QGIS code branch" );
42 versionString += QLatin1String(
"master\n" );
51 versionString += QStringLiteral(
"QGIS code revision %1\n" ).arg(
Qgis::devVersion() );
55 const QString qtVersionCompiled{ QT_VERSION_STR };
56 const QString qtVersionRunning{ qVersion() };
57 if ( qtVersionCompiled != qtVersionRunning )
59 versionString += QStringLiteral(
"Compiled against Qt %1\n" ).arg( qtVersionCompiled );
60 versionString += QStringLiteral(
"Running against Qt %1\n" ).arg( qtVersionRunning );
64 versionString += QStringLiteral(
"Qt version %1\n" ).arg( qtVersionCompiled );
68 versionString += QStringLiteral(
"Python version %1\n" ).arg( PYTHON_VERSION );
71 const QString gdalVersionCompiled { GDAL_RELEASE_NAME };
72 const QString gdalVersionRunning { GDALVersionInfo(
"RELEASE_NAME" ) };
73 if ( gdalVersionCompiled != gdalVersionRunning )
75 versionString += QStringLiteral(
"Compiled against GDAL/OGR %1\n" ).arg( gdalVersionCompiled );
76 versionString += QStringLiteral(
"Running against GDAL/OGR %1\n" ).arg( gdalVersionRunning );
80 versionString += QStringLiteral(
"GDAL/OGR version %1\n" ).arg( gdalVersionCompiled );
84 const PJ_INFO info = proj_info();
85 const QString projVersionCompiled { QStringLiteral(
"%1.%2.%3" ).arg( PROJ_VERSION_MAJOR ).arg( PROJ_VERSION_MINOR ).arg( PROJ_VERSION_PATCH ) };
86 const QString projVersionRunning { info.version };
87 if ( projVersionCompiled != projVersionRunning )
89 versionString += QStringLiteral(
"Compiled against PROJ %1\n" ).arg( projVersionCompiled );
90 versionString += QStringLiteral(
"Running against PROJ %2\n" ).arg( projVersionRunning );
94 versionString += QStringLiteral(
"PROJ version %1\n" ).arg( projVersionCompiled );
101 const QString geosVersionCompiled { GEOS_CAPI_VERSION };
102 const QString geosVersionRunning { GEOSversion() };
103 if ( geosVersionCompiled != geosVersionRunning )
105 versionString += QStringLiteral(
"Compiled against GEOS %1\n" ).arg( geosVersionCompiled );
106 versionString += QStringLiteral(
"Running against GEOS %1\n" ).arg( geosVersionRunning );
110 versionString += QStringLiteral(
"GEOS version %1\n" ).arg( geosVersionCompiled );
114 const QString sqliteVersionCompiled { SQLITE_VERSION };
115 const QString sqliteVersionRunning { sqlite3_libversion() };
116 if ( sqliteVersionCompiled != sqliteVersionRunning )
118 versionString += QStringLiteral(
"Compiled against SQLite %1\n" ).arg( sqliteVersionCompiled );
119 versionString += QStringLiteral(
"Running against SQLite %1\n" ).arg( sqliteVersionRunning );
123 versionString += QStringLiteral(
"SQLite version %1\n" ).arg( sqliteVersionCompiled );
127 versionString += QStringLiteral(
"OS %1\n" ).arg( QSysInfo::prettyProductName() );
130 versionString += QLatin1String(
"This copy of QGIS writes debugging output.\n" );
133 return versionString;