Skip to content

Commit 2a63ed9

Browse files
committed
fix build with -DWITH_GUI=FALSE
1 parent 2f44d52 commit 2a63ed9

File tree

4 files changed

+38
-20
lines changed

4 files changed

+38
-20
lines changed

src/providers/gdal/CMakeLists.txt

+11-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@ SET(GDAL_SRCS
22
qgsgdalproviderbase.cpp
33
qgsgdalprovider.cpp
44
qgsgdaldataitems.cpp
5-
qgsgdalsourceselect.cpp
65
)
76
SET(GDAL_MOC_HDRS
87
qgsgdalprovider.h
98
qgsgdaldataitems.h
10-
qgsgdalsourceselect.h
119
)
1210

11+
IF (WITH_GUI)
12+
SET(GDAL_SRCS ${GDAL_SRCS}
13+
qgsgdalsourceselect.cpp
14+
)
15+
SET(GDAL_MOC_HDRS ${GDAL_MOC_HDRS}
16+
qgsgdalsourceselect.h
17+
)
18+
ENDIF ()
19+
20+
########################################################
21+
1322
INCLUDE_DIRECTORIES (
1423
${CMAKE_SOURCE_DIR}/src/core
1524
${CMAKE_SOURCE_DIR}/src/core/expression

src/providers/geonode/CMakeLists.txt

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11

22
SET (GEONODE_SRCS
3-
qgsgeonodedataitems.cpp
4-
qgsgeonodenewconnection.cpp
53
qgsgeonodeprovider.cpp
6-
qgsgeonodesourceselect.cpp
74
)
85

96
SET(GEONODE_MOC_HDRS
10-
qgsgeonodedataitems.h
11-
qgsgeonodenewconnection.h
12-
qgsgeonodesourceselect.h
137
)
148

9+
IF (WITH_GUI)
10+
SET(GEONODE_SRCS ${GEONODE_SRCS}
11+
qgsgeonodedataitems.cpp
12+
qgsgeonodenewconnection.cpp
13+
qgsgeonodesourceselect.cpp
14+
)
15+
SET(GEONODE_MOC_HDRS ${GEONODE_MOC_HDRS}
16+
qgsgeonodesourceselect.h
17+
qgsgeonodenewconnection.h
18+
qgsgeonodedataitems.h
19+
)
20+
ENDIF ()
21+
1522
########################################################
1623
# Build
1724

src/providers/ogr/CMakeLists.txt

+10-4
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,33 @@ SET (OGR_SRCS
55
qgsogrfeatureiterator.cpp
66
qgsogrconnpool.cpp
77
qgsogrexpressioncompiler.cpp
8-
qgsogrsourceselect.cpp
98
qgsgeopackagedataitems.cpp
109
qgsgeopackagerasterwriter.cpp
1110
qgsgeopackagerasterwritertask.cpp
1211
qgsogrdbconnection.cpp
13-
qgsogrdbsourceselect.cpp
1412
qgsogrdbtablemodel.cpp
1513
)
1614

1715
SET(OGR_MOC_HDRS
1816
qgsogrprovider.h
1917
qgsogrdataitems.h
2018
qgsogrconnpool.h
21-
qgsogrsourceselect.h
2219
qgsgeopackagedataitems.h
2320
qgsgeopackagerasterwritertask.h
2421
qgsogrdbconnection.h
25-
qgsogrdbsourceselect.h
2622
qgsogrdbtablemodel.h
2723
)
2824

25+
IF (WITH_GUI)
26+
SET(OGR_SRCS ${OGR_SRCS}
27+
qgsogrdbsourceselect.cpp
28+
qgsogrsourceselect.cpp
29+
)
30+
SET(OGR_MOC_HDRS ${OGR_MOC_HDRS}
31+
qgsogrsourceselect.h
32+
)
33+
ENDIF ()
34+
2935
########################################################
3036
# Build
3137

src/providers/ogr/qgsgeopackagedataitems.cpp

+4-8
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
#include "qgsrasterlayer.h"
2525
#include "qgsogrprovider.h"
2626
#include "qgsogrdataitems.h"
27+
#ifdef HAVE_GUI
2728
#include "qgsnewgeopackagelayerdialog.h"
29+
#endif
2830
#include "qgsmessageoutput.h"
2931
#include "qgsvectorlayerexporter.h"
3032
#include "qgsgeopackagerasterwritertask.h"
@@ -89,7 +91,6 @@ QWidget *QgsGeoPackageRootItem::paramWidget()
8991
{
9092
return nullptr;
9193
}
92-
#endif
9394

9495
void QgsGeoPackageRootItem::onConnectionsChanged()
9596
{
@@ -104,8 +105,6 @@ void QgsGeoPackageRootItem::newConnection()
104105
}
105106
}
106107

107-
108-
#ifdef HAVE_GUI
109108
void QgsGeoPackageRootItem::createDatabase()
110109
{
111110
QgsNewGeoPackageLayerDialog dialog( nullptr );
@@ -188,9 +187,6 @@ QList<QAction *> QgsGeoPackageCollectionItem::actions( QWidget *parent )
188187

189188
return lst;
190189
}
191-
#endif
192-
193-
194190

195191
bool QgsGeoPackageCollectionItem::handleDrop( const QMimeData *data, Qt::DropAction )
196192
{
@@ -345,7 +341,7 @@ bool QgsGeoPackageCollectionItem::handleDrop( const QMimeData *data, Qt::DropAct
345341
}
346342
return true;
347343
}
348-
344+
#endif
349345

350346
bool QgsGeoPackageCollectionItem::deleteGeoPackageRasterLayer( const QString &uri, QString &errCause )
351347
{
@@ -546,7 +542,6 @@ QList<QAction *> QgsGeoPackageAbstractLayerItem::actions()
546542
lst.append( actionDeleteLayer );
547543
return lst;
548544
}
549-
#endif
550545

551546
void QgsGeoPackageAbstractLayerItem::deleteLayer()
552547
{
@@ -587,6 +582,7 @@ void QgsGeoPackageAbstractLayerItem::deleteLayer()
587582
}
588583

589584
}
585+
#endif
590586

591587
QgsGeoPackageAbstractLayerItem::QgsGeoPackageAbstractLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri, QgsLayerItem::LayerType layerType, const QString &providerKey )
592588
: QgsLayerItem( parent, name, path, uri, layerType, providerKey )

0 commit comments

Comments
 (0)