Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #5338 from PeterPetrik/fix_build_gui_off
fix build with -DWITH_GUI=FALSE
  • Loading branch information
elpaso committed Oct 11, 2017
2 parents 2b742c7 + bf58e3d commit 33d2373
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 20 deletions.
13 changes: 11 additions & 2 deletions src/providers/gdal/CMakeLists.txt
Expand Up @@ -2,14 +2,23 @@ SET(GDAL_SRCS
qgsgdalproviderbase.cpp
qgsgdalprovider.cpp
qgsgdaldataitems.cpp
qgsgdalsourceselect.cpp
)
SET(GDAL_MOC_HDRS
qgsgdalprovider.h
qgsgdaldataitems.h
qgsgdalsourceselect.h
)

IF (WITH_GUI)
SET(GDAL_SRCS ${GDAL_SRCS}
qgsgdalsourceselect.cpp
)
SET(GDAL_MOC_HDRS ${GDAL_MOC_HDRS}
qgsgdalsourceselect.h
)
ENDIF ()

########################################################

INCLUDE_DIRECTORIES (
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/expression
Expand Down
19 changes: 13 additions & 6 deletions src/providers/geonode/CMakeLists.txt
@@ -1,17 +1,24 @@

SET (GEONODE_SRCS
qgsgeonodedataitems.cpp
qgsgeonodenewconnection.cpp
qgsgeonodeprovider.cpp
qgsgeonodesourceselect.cpp
)

SET(GEONODE_MOC_HDRS
qgsgeonodedataitems.h
qgsgeonodenewconnection.h
qgsgeonodesourceselect.h
)

IF (WITH_GUI)
SET(GEONODE_SRCS ${GEONODE_SRCS}
qgsgeonodedataitems.cpp
qgsgeonodenewconnection.cpp
qgsgeonodesourceselect.cpp
)
SET(GEONODE_MOC_HDRS ${GEONODE_MOC_HDRS}
qgsgeonodesourceselect.h
qgsgeonodenewconnection.h
qgsgeonodedataitems.h
)
ENDIF ()

########################################################
# Build

Expand Down
15 changes: 11 additions & 4 deletions src/providers/ogr/CMakeLists.txt
Expand Up @@ -5,27 +5,34 @@ SET (OGR_SRCS
qgsogrfeatureiterator.cpp
qgsogrconnpool.cpp
qgsogrexpressioncompiler.cpp
qgsogrsourceselect.cpp
qgsgeopackagedataitems.cpp
qgsgeopackagerasterwriter.cpp
qgsgeopackagerasterwritertask.cpp
qgsogrdbconnection.cpp
qgsogrdbsourceselect.cpp
qgsogrdbtablemodel.cpp
)

SET(OGR_MOC_HDRS
qgsogrprovider.h
qgsogrdataitems.h
qgsogrconnpool.h
qgsogrsourceselect.h
qgsgeopackagedataitems.h
qgsgeopackagerasterwritertask.h
qgsogrdbconnection.h
qgsogrdbsourceselect.h
qgsogrdbtablemodel.h
)

IF (WITH_GUI)
SET(OGR_SRCS ${OGR_SRCS}
qgsogrdbsourceselect.cpp
qgsogrsourceselect.cpp
)
SET(OGR_MOC_HDRS ${OGR_MOC_HDRS}
qgsogrsourceselect.h
qgsogrdbsourceselect.h
)
ENDIF ()

########################################################
# Build

Expand Down
12 changes: 4 additions & 8 deletions src/providers/ogr/qgsgeopackagedataitems.cpp
Expand Up @@ -24,7 +24,9 @@
#include "qgsrasterlayer.h"
#include "qgsogrprovider.h"
#include "qgsogrdataitems.h"
#ifdef HAVE_GUI
#include "qgsnewgeopackagelayerdialog.h"
#endif
#include "qgsmessageoutput.h"
#include "qgsvectorlayerexporter.h"
#include "qgsgeopackagerasterwritertask.h"
Expand Down Expand Up @@ -89,7 +91,6 @@ QWidget *QgsGeoPackageRootItem::paramWidget()
{
return nullptr;
}
#endif

void QgsGeoPackageRootItem::onConnectionsChanged()
{
Expand All @@ -104,8 +105,6 @@ void QgsGeoPackageRootItem::newConnection()
}
}


#ifdef HAVE_GUI
void QgsGeoPackageRootItem::createDatabase()
{
QgsNewGeoPackageLayerDialog dialog( nullptr );
Expand Down Expand Up @@ -188,9 +187,6 @@ QList<QAction *> QgsGeoPackageCollectionItem::actions( QWidget *parent )

return lst;
}
#endif



bool QgsGeoPackageCollectionItem::handleDrop( const QMimeData *data, Qt::DropAction )
{
Expand Down Expand Up @@ -345,7 +341,7 @@ bool QgsGeoPackageCollectionItem::handleDrop( const QMimeData *data, Qt::DropAct
}
return true;
}

#endif

bool QgsGeoPackageCollectionItem::deleteGeoPackageRasterLayer( const QString &uri, QString &errCause )
{
Expand Down Expand Up @@ -546,7 +542,6 @@ QList<QAction *> QgsGeoPackageAbstractLayerItem::actions()
lst.append( actionDeleteLayer );
return lst;
}
#endif

void QgsGeoPackageAbstractLayerItem::deleteLayer()
{
Expand Down Expand Up @@ -587,6 +582,7 @@ void QgsGeoPackageAbstractLayerItem::deleteLayer()
}

}
#endif

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

0 comments on commit 33d2373

Please sign in to comment.