Skip to content
Permalink
Browse files
Keep providers in a separate dir to plugins
  • Loading branch information
timlinux committed Nov 19, 2011
1 parent f0f8a12 commit 33ae3f96e64dabc008e74f59bbdee21f3bfd1852
@@ -253,6 +253,7 @@ IF (WIN32)
SET (DEFAULT_LIBEXEC_SUBDIR .)
SET (DEFAULT_DATA_SUBDIR .)
SET (DEFAULT_PLUGIN_SUBDIR plugins)
SET (DEFAULT_PROVIDER_SUBDIR providers)
SET (DEFAULT_INCLUDE_SUBDIR include)

IF (MSVC)
@@ -322,6 +323,8 @@ ELSE (WIN32)
SET (QGIS_LIBEXEC_SUBDIR_REV ../..)
SET (DEFAULT_PLUGIN_SUBDIR ../PlugIns/qgis)
SET (QGIS_PLUGIN_SUBDIR_REV ../../MacOS)
SET (DEFAULT_PROVIDER_SUBDIR ../Providers/qgis)
SET (QGIS_PROVIDER_SUBDIR_REV ../../MacOS)
SET (DEFAULT_INCLUDE_SUBDIR include/qgis)
# path for framework references
SET (CMAKE_INSTALL_NAME_DIR @executable_path/${QGIS_FW_SUBDIR})
@@ -334,6 +337,7 @@ ELSE (WIN32)
SET (DEFAULT_DATA_SUBDIR share/qgis)
SET (DEFAULT_LIBEXEC_SUBDIR lib${LIB_SUFFIX}/qgis)
SET (DEFAULT_PLUGIN_SUBDIR lib${LIB_SUFFIX}/qgis/plugins)
SET (DEFAULT_PROVIDER_SUBDIR lib${LIB_SUFFIX}/qgis/providers)
SET (DEFAULT_INCLUDE_SUBDIR include/qgis)
ENDIF (APPLE)

@@ -373,11 +377,12 @@ SET (QGIS_LIB_SUBDIR ${DEFAULT_LIB_SUBDIR} CACHE STRING "Subdirectory wh
SET (QGIS_LIBEXEC_SUBDIR ${DEFAULT_LIBEXEC_SUBDIR} CACHE STRING "Subdirectory where private executables will be installed")
SET (QGIS_DATA_SUBDIR ${DEFAULT_DATA_SUBDIR} CACHE STRING "Subdirectory where QGIS data will be installed")
SET (QGIS_PLUGIN_SUBDIR ${DEFAULT_PLUGIN_SUBDIR} CACHE STRING "Subdirectory where plugins will be installed")
SET (QGIS_PROVIDER_SUBDIR ${DEFAULT_PROVIDER_SUBDIR} CACHE STRING "Subdirectory where providers will be installed")
SET (QGIS_INCLUDE_SUBDIR ${DEFAULT_INCLUDE_SUBDIR} CACHE STRING "Subdirectory where header files will be installed")

# mark *_SUBDIR variables as advanced as this is not something
# that an average user would use
MARK_AS_ADVANCED (QGIS_BIN_SUBDIR QGIS_CGIBIN_SUBDIR QGIS_LIB_SUBDIR QGIS_LIBEXEC_SUBDIR QGIS_DATA_SUBDIR QGIS_PLUGIN_SUBDIR QGIS_INCLUDE_SUBDIR)
MARK_AS_ADVANCED (QGIS_BIN_SUBDIR QGIS_CGIBIN_SUBDIR QGIS_LIB_SUBDIR QGIS_LIBEXEC_SUBDIR QGIS_DATA_SUBDIR QGIS_PROVIDER_SUBDIR QGIS_PLUGIN_SUBDIR QGIS_INCLUDE_SUBDIR)

# full paths for the installation
SET (QGIS_BIN_DIR ${QGIS_BIN_SUBDIR})
@@ -386,6 +391,7 @@ SET (QGIS_LIB_DIR ${QGIS_LIB_SUBDIR})
SET (QGIS_LIBEXEC_DIR ${QGIS_LIBEXEC_SUBDIR})
SET (QGIS_DATA_DIR ${QGIS_DATA_SUBDIR})
SET (QGIS_PLUGIN_DIR ${QGIS_PLUGIN_SUBDIR})
SET (QGIS_PROVIDER_DIR ${QGIS_PROVIDER_SUBDIR})
SET (QGIS_INCLUDE_DIR ${QGIS_INCLUDE_SUBDIR})

# set the default locations where the targets (executables, libraries) will land when compiled
@@ -21,6 +21,7 @@
#define RELEASE_NAME "${RELEASE_NAME}"

#define QGIS_PLUGIN_SUBDIR "${QGIS_PLUGIN_SUBDIR}"
#define QGIS_PROVIDER_SUBDIR "${QGIS_PROVIDER_SUBDIR}"
#define QGIS_DATA_SUBDIR "${QGIS_DATA_SUBDIR}"
#define QGIS_LIBEXEC_SUBDIR "${QGIS_LIBEXEC_SUBDIR}"
#define QGIS_LIB_SUBDIR "${QGIS_LIB_SUBDIR}"
@@ -41,6 +41,7 @@ QObject * QgsApplication::mFileOpenEventReceiver;
QStringList QgsApplication::mFileOpenEventList;
QString QgsApplication::mPrefixPath;
QString QgsApplication::mPluginPath;
QString QgsApplication::mProviderPath;
QString QgsApplication::mPkgDataPath;
QString QgsApplication::mLibraryPath;
QString QgsApplication::mLibexecPath;
@@ -97,6 +98,7 @@ void QgsApplication::init( QString customConfigPath )
// we run from source directory - not installed to destination (specified prefix)
mPrefixPath = QString(); // set invalid path
setPluginPath( mBuildOutputPath + "/" + QString( QGIS_PLUGIN_SUBDIR ) );
setProviderPath( mBuildOutputPath + "/" + QString( QGIS_PROVIDER_SUBDIR ) );
setPkgDataPath( mBuildSourcePath ); // directly source path - used for: doc, resources, svg
mLibraryPath = mBuildOutputPath + "/" + QGIS_LIB_SUBDIR + "/";
mLibexecPath = mBuildOutputPath + "/" + QGIS_LIBEXEC_SUBDIR + "/";
@@ -232,6 +234,7 @@ void QgsApplication::setPrefixPath( const QString thePrefixPath, bool useDefault
if ( useDefaultPaths )
{
setPluginPath( mPrefixPath + "/" + QString( QGIS_PLUGIN_SUBDIR ) );
setProviderPath( mPrefixPath + "/" + QString( QGIS_PROVIDER_SUBDIR ) );
setPkgDataPath( mPrefixPath + "/" + QString( QGIS_DATA_SUBDIR ) );
}
mLibraryPath = mPrefixPath + "/" + QGIS_LIB_SUBDIR + "/";
@@ -243,6 +246,11 @@ void QgsApplication::setPluginPath( const QString thePluginPath )
mPluginPath = thePluginPath;
}

void QgsApplication::setProviderPath( const QString theProviderPath )
{
mProviderPath = theProviderPath;
}

void QgsApplication::setPkgDataPath( const QString thePkgDataPath )
{
mPkgDataPath = thePkgDataPath;
@@ -266,6 +274,10 @@ const QString QgsApplication::prefixPath()

return mPrefixPath;
}
const QString QgsApplication::providerPath()
{
return mProviderPath;
}
const QString QgsApplication::pluginPath()
{
return mPluginPath;
@@ -490,7 +502,7 @@ QgsApplication::endian_t QgsApplication::endian()
void QgsApplication::initQgis()
{
// set the provider plugin path (this creates provider registry)
QgsProviderRegistry::instance( pluginPath() );
QgsProviderRegistry::instance( providerPath() );

// create map layer registry if doesn't exist
QgsMapLayerRegistry::instance();
@@ -507,6 +519,7 @@ QString QgsApplication::showSettings()
QString myState = QString( "Application state:\n"
"Prefix : %1\n"
"Plugin Path : %2\n"
"Provider Path : %2\n"
"Package Data Path : %3\n"
"Active Theme Name : %4\n"
"Active Theme Path : %5\n"
@@ -515,6 +528,7 @@ QString QgsApplication::showSettings()
"User DB Path : %8\n" )
.arg( mPrefixPath )
.arg( mPluginPath )
.arg( mProviderPath )
.arg( mPkgDataPath )
.arg( themeName() )
.arg( activeThemePath() )
@@ -133,6 +133,9 @@ class CORE_EXPORT QgsApplication: public QApplication
//! Returns the path to the application plugin directory.
static const QString pluginPath();

//! Returns the path to the application data providers directory.
static const QString providerPath();

//! Returns the common root path of all application data directories.
static const QString pkgDataPath();

@@ -164,6 +167,11 @@ class CORE_EXPORT QgsApplication: public QApplication
//! Alters prefix path - used by 3rd party apps
static void setPrefixPath( const QString thePrefixPath, bool useDefaultPaths = false );

/** Alters provider path - providers are used to connect to a data source
* @note Added in 2.0
*/
static void setProviderPath( const QString theProviderPath );

//! Alters plugin path - used by 3rd party apps
static void setPluginPath( const QString thePluginPath );

@@ -262,6 +270,7 @@ class CORE_EXPORT QgsApplication: public QApplication
static QStringList mFileOpenEventList;

static QString mPrefixPath;
static QString mProviderPath;
static QString mPluginPath;
static QString mPkgDataPath;
static QString mLibraryPath;
@@ -1,6 +1,6 @@
# override default path where built files are put to allow running qgis without installing
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PROVIDER_SUBDIR})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PROVIDER_SUBDIR})

ADD_SUBDIRECTORY(memory)
ADD_SUBDIRECTORY(ogr)
@@ -28,5 +28,5 @@ TARGET_LINK_LIBRARIES(delimitedtextprovider
# Install

INSTALL (TARGETS delimitedtextprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})
@@ -17,6 +17,6 @@ TARGET_LINK_LIBRARIES (gdalprovider
)

INSTALL(TARGETS gdalprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

@@ -31,5 +31,5 @@ TARGET_LINK_LIBRARIES(gpxprovider
# Install

INSTALL (TARGETS gpxprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})
@@ -102,12 +102,12 @@ INSTALL(TARGETS qgisgrass
FRAMEWORK DESTINATION ${QGIS_FW_SUBDIR})

INSTALL(TARGETS grassprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

INSTALL(TARGETS grassrasterprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

INSTALL(TARGETS qgis.d.rast qgis.g.info
RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR}/grass/modules
@@ -16,5 +16,5 @@ TARGET_LINK_LIBRARIES(memoryprovider


INSTALL (TARGETS memoryprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})
@@ -27,6 +27,6 @@ IF (MSVC)
ENDIF (MSVC)

INSTALL (TARGETS ogrprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

@@ -40,5 +40,5 @@ TARGET_LINK_LIBRARIES (osmprovider
# Install

INSTALL(TARGETS osmprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})
@@ -45,5 +45,5 @@ TARGET_LINK_LIBRARIES (postgresprovider
# Install

INSTALL(TARGETS postgresprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})
@@ -58,5 +58,5 @@ ENDIF(NOT WITH_INTERNAL_SPATIALITE)
# Install

INSTALL(TARGETS spatialiteprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})
@@ -31,6 +31,6 @@ TARGET_LINK_LIBRARIES(sqlanywhereprovider
# Install

INSTALL(TARGETS sqlanywhereprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

@@ -50,12 +50,12 @@ ENDIF (APPLE)

IF (WIN32)
INSTALL(TARGETS qgissqlanyconnection
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR}
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR}
)
ELSE (WIN32)
INSTALL(TARGETS qgissqlanyconnection
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_LIB_DIR}
FRAMEWORK DESTINATION ${QGIS_FW_SUBDIR}
)
@@ -51,5 +51,5 @@ TARGET_LINK_LIBRARIES (wfsprovider
# Install

INSTALL(TARGETS wfsprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})
@@ -27,5 +27,5 @@ TARGET_LINK_LIBRARIES(wmsprovider
)

INSTALL (TARGETS wmsprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

0 comments on commit 33ae3f9

Please sign in to comment.