Skip to content

Commit

Permalink
Use install prefix for the mapserver to locate vector provider libs
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14120 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Aug 22, 2010
1 parent 11585b2 commit 3895e04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions cmake_templates/qgsconfig.h.in
Expand Up @@ -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

Expand Down
10 changes: 4 additions & 6 deletions src/mapserver/qgis_map_serv.cpp
Expand Up @@ -34,6 +34,9 @@ map service syntax for SOAP/HTTP POST
#include <iostream>
#include <stdlib.h>

//for CMAKE_INSTALL_PREFIX
#include "qgsconfig.h"


#ifdef WIN32
#include <fcntl.h>
Expand Down Expand Up @@ -122,13 +125,8 @@ int main( int argc, char * argv[] )

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() );
Expand Down

0 comments on commit 3895e04

Please sign in to comment.