Skip to content

Commit 33ae3f9

Browse files
committedNov 19, 2011
Keep providers in a separate dir to plugins
1 parent f0f8a12 commit 33ae3f9

File tree

18 files changed

+63
-33
lines changed

18 files changed

+63
-33
lines changed
 

‎CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ IF (WIN32)
253253
SET (DEFAULT_LIBEXEC_SUBDIR .)
254254
SET (DEFAULT_DATA_SUBDIR .)
255255
SET (DEFAULT_PLUGIN_SUBDIR plugins)
256+
SET (DEFAULT_PROVIDER_SUBDIR providers)
256257
SET (DEFAULT_INCLUDE_SUBDIR include)
257258

258259
IF (MSVC)
@@ -322,6 +323,8 @@ ELSE (WIN32)
322323
SET (QGIS_LIBEXEC_SUBDIR_REV ../..)
323324
SET (DEFAULT_PLUGIN_SUBDIR ../PlugIns/qgis)
324325
SET (QGIS_PLUGIN_SUBDIR_REV ../../MacOS)
326+
SET (DEFAULT_PROVIDER_SUBDIR ../Providers/qgis)
327+
SET (QGIS_PROVIDER_SUBDIR_REV ../../MacOS)
325328
SET (DEFAULT_INCLUDE_SUBDIR include/qgis)
326329
# path for framework references
327330
SET (CMAKE_INSTALL_NAME_DIR @executable_path/${QGIS_FW_SUBDIR})
@@ -334,6 +337,7 @@ ELSE (WIN32)
334337
SET (DEFAULT_DATA_SUBDIR share/qgis)
335338
SET (DEFAULT_LIBEXEC_SUBDIR lib${LIB_SUFFIX}/qgis)
336339
SET (DEFAULT_PLUGIN_SUBDIR lib${LIB_SUFFIX}/qgis/plugins)
340+
SET (DEFAULT_PROVIDER_SUBDIR lib${LIB_SUFFIX}/qgis/providers)
337341
SET (DEFAULT_INCLUDE_SUBDIR include/qgis)
338342
ENDIF (APPLE)
339343

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

378383
# mark *_SUBDIR variables as advanced as this is not something
379384
# that an average user would use
380-
MARK_AS_ADVANCED (QGIS_BIN_SUBDIR QGIS_CGIBIN_SUBDIR QGIS_LIB_SUBDIR QGIS_LIBEXEC_SUBDIR QGIS_DATA_SUBDIR QGIS_PLUGIN_SUBDIR QGIS_INCLUDE_SUBDIR)
385+
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)
381386

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

391397
# set the default locations where the targets (executables, libraries) will land when compiled

‎cmake_templates/qgsconfig.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define RELEASE_NAME "${RELEASE_NAME}"
2222

2323
#define QGIS_PLUGIN_SUBDIR "${QGIS_PLUGIN_SUBDIR}"
24+
#define QGIS_PROVIDER_SUBDIR "${QGIS_PROVIDER_SUBDIR}"
2425
#define QGIS_DATA_SUBDIR "${QGIS_DATA_SUBDIR}"
2526
#define QGIS_LIBEXEC_SUBDIR "${QGIS_LIBEXEC_SUBDIR}"
2627
#define QGIS_LIB_SUBDIR "${QGIS_LIB_SUBDIR}"

‎src/core/qgsapplication.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ QObject * QgsApplication::mFileOpenEventReceiver;
4141
QStringList QgsApplication::mFileOpenEventList;
4242
QString QgsApplication::mPrefixPath;
4343
QString QgsApplication::mPluginPath;
44+
QString QgsApplication::mProviderPath;
4445
QString QgsApplication::mPkgDataPath;
4546
QString QgsApplication::mLibraryPath;
4647
QString QgsApplication::mLibexecPath;
@@ -97,6 +98,7 @@ void QgsApplication::init( QString customConfigPath )
9798
// we run from source directory - not installed to destination (specified prefix)
9899
mPrefixPath = QString(); // set invalid path
99100
setPluginPath( mBuildOutputPath + "/" + QString( QGIS_PLUGIN_SUBDIR ) );
101+
setProviderPath( mBuildOutputPath + "/" + QString( QGIS_PROVIDER_SUBDIR ) );
100102
setPkgDataPath( mBuildSourcePath ); // directly source path - used for: doc, resources, svg
101103
mLibraryPath = mBuildOutputPath + "/" + QGIS_LIB_SUBDIR + "/";
102104
mLibexecPath = mBuildOutputPath + "/" + QGIS_LIBEXEC_SUBDIR + "/";
@@ -232,6 +234,7 @@ void QgsApplication::setPrefixPath( const QString thePrefixPath, bool useDefault
232234
if ( useDefaultPaths )
233235
{
234236
setPluginPath( mPrefixPath + "/" + QString( QGIS_PLUGIN_SUBDIR ) );
237+
setProviderPath( mPrefixPath + "/" + QString( QGIS_PROVIDER_SUBDIR ) );
235238
setPkgDataPath( mPrefixPath + "/" + QString( QGIS_DATA_SUBDIR ) );
236239
}
237240
mLibraryPath = mPrefixPath + "/" + QGIS_LIB_SUBDIR + "/";
@@ -243,6 +246,11 @@ void QgsApplication::setPluginPath( const QString thePluginPath )
243246
mPluginPath = thePluginPath;
244247
}
245248

249+
void QgsApplication::setProviderPath( const QString theProviderPath )
250+
{
251+
mProviderPath = theProviderPath;
252+
}
253+
246254
void QgsApplication::setPkgDataPath( const QString thePkgDataPath )
247255
{
248256
mPkgDataPath = thePkgDataPath;
@@ -266,6 +274,10 @@ const QString QgsApplication::prefixPath()
266274

267275
return mPrefixPath;
268276
}
277+
const QString QgsApplication::providerPath()
278+
{
279+
return mProviderPath;
280+
}
269281
const QString QgsApplication::pluginPath()
270282
{
271283
return mPluginPath;
@@ -490,7 +502,7 @@ QgsApplication::endian_t QgsApplication::endian()
490502
void QgsApplication::initQgis()
491503
{
492504
// set the provider plugin path (this creates provider registry)
493-
QgsProviderRegistry::instance( pluginPath() );
505+
QgsProviderRegistry::instance( providerPath() );
494506

495507
// create map layer registry if doesn't exist
496508
QgsMapLayerRegistry::instance();
@@ -507,6 +519,7 @@ QString QgsApplication::showSettings()
507519
QString myState = QString( "Application state:\n"
508520
"Prefix : %1\n"
509521
"Plugin Path : %2\n"
522+
"Provider Path : %2\n"
510523
"Package Data Path : %3\n"
511524
"Active Theme Name : %4\n"
512525
"Active Theme Path : %5\n"
@@ -515,6 +528,7 @@ QString QgsApplication::showSettings()
515528
"User DB Path : %8\n" )
516529
.arg( mPrefixPath )
517530
.arg( mPluginPath )
531+
.arg( mProviderPath )
518532
.arg( mPkgDataPath )
519533
.arg( themeName() )
520534
.arg( activeThemePath() )

‎src/core/qgsapplication.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ class CORE_EXPORT QgsApplication: public QApplication
133133
//! Returns the path to the application plugin directory.
134134
static const QString pluginPath();
135135

136+
//! Returns the path to the application data providers directory.
137+
static const QString providerPath();
138+
136139
//! Returns the common root path of all application data directories.
137140
static const QString pkgDataPath();
138141

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

170+
/** Alters provider path - providers are used to connect to a data source
171+
* @note Added in 2.0
172+
*/
173+
static void setProviderPath( const QString theProviderPath );
174+
167175
//! Alters plugin path - used by 3rd party apps
168176
static void setPluginPath( const QString thePluginPath );
169177

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

264272
static QString mPrefixPath;
273+
static QString mProviderPath;
265274
static QString mPluginPath;
266275
static QString mPkgDataPath;
267276
static QString mLibraryPath;

‎src/providers/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# override default path where built files are put to allow running qgis without installing
2-
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
3-
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
2+
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PROVIDER_SUBDIR})
3+
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PROVIDER_SUBDIR})
44

55
ADD_SUBDIRECTORY(memory)
66
ADD_SUBDIRECTORY(ogr)

‎src/providers/delimitedtext/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ TARGET_LINK_LIBRARIES(delimitedtextprovider
2828
# Install
2929

3030
INSTALL (TARGETS delimitedtextprovider
31-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
32-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
31+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
32+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

‎src/providers/gdal/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ TARGET_LINK_LIBRARIES (gdalprovider
1717
)
1818

1919
INSTALL(TARGETS gdalprovider
20-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
21-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
20+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
21+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})
2222

‎src/providers/gpx/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ TARGET_LINK_LIBRARIES(gpxprovider
3131
# Install
3232

3333
INSTALL (TARGETS gpxprovider
34-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
35-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
34+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
35+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

‎src/providers/grass/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ INSTALL(TARGETS qgisgrass
102102
FRAMEWORK DESTINATION ${QGIS_FW_SUBDIR})
103103

104104
INSTALL(TARGETS grassprovider
105-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
106-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
105+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
106+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})
107107

108108
INSTALL(TARGETS grassrasterprovider
109-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
110-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
109+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
110+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})
111111

112112
INSTALL(TARGETS qgis.d.rast qgis.g.info
113113
RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR}/grass/modules

‎src/providers/memory/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ TARGET_LINK_LIBRARIES(memoryprovider
1616

1717

1818
INSTALL (TARGETS memoryprovider
19-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
20-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
19+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
20+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

‎src/providers/ogr/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ IF (MSVC)
2727
ENDIF (MSVC)
2828

2929
INSTALL (TARGETS ogrprovider
30-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
31-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
30+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
31+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})
3232

‎src/providers/osm/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ TARGET_LINK_LIBRARIES (osmprovider
4040
# Install
4141

4242
INSTALL(TARGETS osmprovider
43-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
44-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
43+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
44+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

‎src/providers/postgres/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ TARGET_LINK_LIBRARIES (postgresprovider
4545
# Install
4646

4747
INSTALL(TARGETS postgresprovider
48-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
49-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
48+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
49+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

‎src/providers/spatialite/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ ENDIF(NOT WITH_INTERNAL_SPATIALITE)
5858
# Install
5959

6060
INSTALL(TARGETS spatialiteprovider
61-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
62-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
61+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
62+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

‎src/providers/sqlanywhere/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ TARGET_LINK_LIBRARIES(sqlanywhereprovider
3131
# Install
3232

3333
INSTALL(TARGETS sqlanywhereprovider
34-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
35-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
34+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
35+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})
3636

‎src/providers/sqlanywhere/sqlanyconnection/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ ENDIF (APPLE)
5050

5151
IF (WIN32)
5252
INSTALL(TARGETS qgissqlanyconnection
53-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
54-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR}
53+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
54+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR}
5555
)
5656
ELSE (WIN32)
5757
INSTALL(TARGETS qgissqlanyconnection
58-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
58+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
5959
LIBRARY DESTINATION ${QGIS_LIB_DIR}
6060
FRAMEWORK DESTINATION ${QGIS_FW_SUBDIR}
6161
)

‎src/providers/wfs/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ TARGET_LINK_LIBRARIES (wfsprovider
5151
# Install
5252

5353
INSTALL(TARGETS wfsprovider
54-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
55-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
54+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
55+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

‎src/providers/wms/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ TARGET_LINK_LIBRARIES(wmsprovider
2727
)
2828

2929
INSTALL (TARGETS wmsprovider
30-
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
31-
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
30+
RUNTIME DESTINATION ${QGIS_PROVIDER_DIR}
31+
LIBRARY DESTINATION ${QGIS_PROVIDER_DIR})

0 commit comments

Comments
 (0)
Please sign in to comment.