[QGIS Commit] r14120 - in trunk/qgis: cmake_templates src/mapserver

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Aug 22 06:20:28 EDT 2010


Author: mhugent
Date: 2010-08-22 10:20:28 +0000 (Sun, 22 Aug 2010)
New Revision: 14120

Modified:
   trunk/qgis/cmake_templates/qgsconfig.h.in
   trunk/qgis/src/mapserver/qgis_map_serv.cpp
Log:
Use install prefix for the mapserver to locate vector provider libs

Modified: trunk/qgis/cmake_templates/qgsconfig.h.in
===================================================================
--- trunk/qgis/cmake_templates/qgsconfig.h.in	2010-08-22 08:15:42 UTC (rev 14119)
+++ trunk/qgis/cmake_templates/qgsconfig.h.in	2010-08-22 10:20:28 UTC (rev 14120)
@@ -24,6 +24,7 @@
 #define QGIS_DATA_SUBDIR "${QGIS_DATA_SUBDIR}"
 #define QGIS_LIBEXEC_SUBDIR "${QGIS_LIBEXEC_SUBDIR}"
 #define QGIS_LIB_SUBDIR "${QGIS_LIB_SUBDIR}"
+#define CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}"
 
 #cmakedefine HAVE_POSTGRESQL
 

Modified: trunk/qgis/src/mapserver/qgis_map_serv.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgis_map_serv.cpp	2010-08-22 08:15:42 UTC (rev 14119)
+++ trunk/qgis/src/mapserver/qgis_map_serv.cpp	2010-08-22 10:20:28 UTC (rev 14120)
@@ -34,7 +34,10 @@
 #include <iostream>
 #include <stdlib.h>
 
+//for CMAKE_INSTALL_PREFIX
+#include "qgsconfig.h"
 
+
 #ifdef WIN32
 #include <fcntl.h>
 #endif //WIN32
@@ -122,13 +125,8 @@
 
   QgsApplication qgsapp( argc, argv, false );
 
-  QString myQGisDir( QGIS_LIB_DIR ); //defined in CmakeLists.txt
-  myQGisDir += QDir::separator();
-#ifdef Q_OS_LINUX
-  myQGisDir += "/../";
-#endif
   // init QGIS's paths - true means that all path will be inited from prefix
-  QgsApplication::setPrefixPath( myQGisDir, TRUE );
+  QgsApplication::setPrefixPath( CMAKE_INSTALL_PREFIX, TRUE );
 
   // Instantiate the plugin directory so that providers are loaded
   QgsProviderRegistry::instance( QgsApplication::pluginPath() );



More information about the QGIS-commit mailing list