Skip to content

Commit 8d5ad0c

Browse files
author
jef
committed
make QWT support configurable
git-svn-id: http://svn.osgeo.org/qgis/trunk@12707 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 987a9b6 commit 8d5ad0c

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ IF (WITH_POSTGRESQL)
5252
SET (POSTGRESQL_PREFIX "" CACHE PATH "Path to POSTGRESQL base directory")
5353
ENDIF (WITH_POSTGRESQL)
5454

55+
SET (WITH_QWT TRUE CACHE BOOL "Determines whether QWT support should be included (currently used for GPS widget)")
56+
5557
SET (WITH_SPATIALITE TRUE CACHE BOOL "Determines whether SPATIALITE support should be built")
5658

5759
IF (WITH_SPATIALITE)
@@ -132,7 +134,6 @@ FIND_PACKAGE(Expat) # GPS importer plugin
132134
FIND_PACKAGE(GSL) # Georeferencer
133135
FIND_PACKAGE(GEOS)
134136
FIND_PACKAGE(GDAL)
135-
FIND_PACKAGE(QWT)
136137

137138
IF (NOT WITH_INTERNAL_SPATIALITE)
138139
FIND_PACKAGE(Sqlite3)
@@ -148,6 +149,9 @@ ENDIF (WITH_POSTGRESQL)
148149
IF (WITH_GRASS)
149150
FIND_PACKAGE(GRASS) # GRASS plugin
150151
ENDIF (WITH_GRASS)
152+
IF (WITH_QWT)
153+
FIND_PACKAGE(QWT)
154+
ENDIF(WITH_QWT)
151155

152156
IF (WITH_SPATIALITE AND NOT WITH_INTERNAL_SPATIALITE)
153157
FIND_PACKAGE(SPATIALITE)

cmake/FindQWT.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ENDIF (QWT_INCLUDE_DIR AND QWT_LIBRARY)
3737

3838
IF (QWT_FOUND)
3939
IF (NOT QWT_FIND_QUIETLY)
40-
MESSAGE(STATUS "Found QWT : ${QWT_LIBRARY}")
40+
MESSAGE(STATUS "Found QWT: ${QWT_LIBRARY}")
4141
ENDIF (NOT QWT_FIND_QUIETLY)
4242
ELSE (QWT_FOUND)
4343
IF (QWT_FIND_REQUIRED)

src/app/qgisapp.cpp

+16-8
Original file line numberDiff line numberDiff line change
@@ -958,12 +958,13 @@ void QgisApp::createActions()
958958
connect( mActionRemoveLayer, SIGNAL( triggered() ), this, SLOT( removeLayer() ) );
959959
mActionRemoveLayer->setEnabled( false );
960960

961+
#ifdef HAVE_QWT
961962
mActionGpsTool = new QAction( getThemeIcon( "mActionGpsTool.png" ), tr( "Live GPS tracking" ), this );
962963
shortcuts->registerAction( mActionGpsTool, tr( "", "Live GPS tracking" ) );
963964
mActionGpsTool->setStatusTip( tr( "Show GPS tool" ) );
964965
connect( mActionGpsTool, SIGNAL( triggered() ), this, SLOT( showGpsTool() ) );
965966
mActionGpsTool->setEnabled( true );
966-
967+
#endif
967968

968969
mActionLayerProperties = new QAction( tr( "Properties..." ), this );
969970
shortcuts->registerAction( mActionLayerProperties );
@@ -1322,7 +1323,9 @@ void QgisApp::createMenus()
13221323
mViewMenu->addMenu( mToolbarMenu );
13231324
mViewMenu->addAction( mActionToggleFullScreen );
13241325
}
1326+
#ifdef HAVE_QWT
13251327
mViewMenu->addAction( mActionGpsTool );
1328+
#endif
13261329

13271330
// Layers Menu
13281331

@@ -2157,9 +2160,9 @@ void QgisApp::about()
21572160
.arg( QGis::QGIS_VERSION )
21582161
.arg( QGis::QGIS_SVN_VERSION );
21592162
#ifdef HAVE_POSTGRESQL
2160-
versionString += tr( " This copy of QGIS has been built with PostgreSQL support." );
2163+
versionString += tr( "\nThis copy of QGIS has been built with PostgreSQL support." );
21612164
#else
2162-
versionString += tr( " This copy of QGIS has been built without PostgreSQL support." );
2165+
versionString += tr( "\nThis copy of QGIS has been built without PostgreSQL support." );
21632166
#endif
21642167

21652168
#ifdef HAVE_SPATIALITE
@@ -2168,16 +2171,21 @@ void QgisApp::about()
21682171
versionString += tr( "\nThis copy of QGIS has been built without SpatiaLite support." );
21692172
#endif
21702173

2174+
#ifdef HAVE_QWT
2175+
versionString += tr( "\nThis copy of QGIS has been built with QWT support (%1)." ).arg( QWT_VERSION_STR );
2176+
#else
2177+
versionString += tr( "\nThis copy of QGIS has been built without QWT support." );
2178+
#endif
2179+
2180+
#ifdef QGISDEBUG
2181+
versionString += tr( "\nThis copy of QGIS writes debugging output." );
2182+
#endif
2183+
21712184
versionString += tr( "\nThis binary was compiled against Qt %1,"
21722185
"and is currently running against Qt %2" )
21732186
.arg( QT_VERSION_STR )
21742187
.arg( qVersion() );
21752188

2176-
#ifdef WIN32
2177-
// special version stuff for windows (if required)
2178-
// versionString += "\nThis is a Windows preview release - not for production use";
2179-
#endif
2180-
21812189
abt->setVersion( versionString );
21822190
QString whatsNew = "<html><body>" ;
21832191
whatsNew += "<h2>" + tr( "Version" ) + " " + QString( QGis::QGIS_VERSION ) + "</h2>";

src/app/qgisapp.h

+4
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ class QgisApp : public QMainWindow
275275
QAction *actionLayerSaveAs() { return mActionLayerSaveAs; }
276276
QAction *actionLayerSelectionSaveAs() { return mActionLayerSelectionSaveAs; }
277277
QAction *actionRemoveLayer() { return mActionRemoveLayer; }
278+
#ifdef HAVE_QWT
278279
QAction *actionGpsTool() { return mActionGpsTool; }
280+
#endif
279281
QAction *actionLayerProperties() { return mActionLayerProperties; }
280282
QAction *actionLayerSeparator2() { return mActionLayerSeparator2; }
281283
QAction *actionAddToOverview() { return mActionAddToOverview; }
@@ -834,7 +836,9 @@ class QgisApp : public QMainWindow
834836
QAction *mActionLayerSaveAs;
835837
QAction *mActionLayerSelectionSaveAs;
836838
QAction *mActionRemoveLayer;
839+
#ifdef HAVE_QWT
837840
QAction *mActionGpsTool;
841+
#endif
838842
QAction *mActionLayerProperties;
839843
QAction *mActionLayerSeparator2;
840844
QAction *mActionAddToOverview;

0 commit comments

Comments
 (0)