[QGIS Commit] r9943 - in trunk/qgis: cmake src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Jan 7 19:05:23 EST 2009


Author: jef
Date: 2009-01-07 19:05:23 -0500 (Wed, 07 Jan 2009)
New Revision: 9943

Modified:
   trunk/qgis/cmake/FindPostgres.cmake
   trunk/qgis/src/app/CMakeLists.txt
   trunk/qgis/src/app/qgsdbsourceselect.cpp
Log:
fix postgres <8.3 support

Modified: trunk/qgis/cmake/FindPostgres.cmake
===================================================================
--- trunk/qgis/cmake/FindPostgres.cmake	2009-01-07 22:54:16 UTC (rev 9942)
+++ trunk/qgis/cmake/FindPostgres.cmake	2009-01-08 00:05:23 UTC (rev 9943)
@@ -61,6 +61,13 @@
 
 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)
 
 

Modified: trunk/qgis/src/app/CMakeLists.txt
===================================================================
--- trunk/qgis/src/app/CMakeLists.txt	2009-01-07 22:54:16 UTC (rev 9942)
+++ trunk/qgis/src/app/CMakeLists.txt	2009-01-08 00:05:23 UTC (rev 9943)
@@ -140,6 +140,10 @@
   )
 
 IF (POSTGRES_FOUND)
+  IF(HAVE_PGCONFIG)
+    ADD_DEFINITIONS(-DHAVE_PGCONFIG=1)
+  ENDIF(HAVE_PGCONFIG)
+
   SET (QGIS_APP_SRCS ${QGIS_APP_SRCS}
     qgsdbsourceselect.cpp
     qgsnewconnection.cpp

Modified: trunk/qgis/src/app/qgsdbsourceselect.cpp
===================================================================
--- trunk/qgis/src/app/qgsdbsourceselect.cpp	2009-01-07 22:54:16 UTC (rev 9942)
+++ trunk/qgis/src/app/qgsdbsourceselect.cpp	2009-01-08 00:05:23 UTC (rev 9943)
@@ -38,7 +38,9 @@
 #include <cassert>
 #include <iostream>
 
+#ifdef HAVE_PGCONFIG
 #include <pg_config.h>
+#endif
 
 QgsDbSourceSelect::QgsDbSourceSelect( QWidget *parent, Qt::WFlags fl )
     : QDialog( parent, fl ), mColumnTypeThread( NULL ), pd( 0 )



More information about the QGIS-commit mailing list