Skip to content
Permalink
Browse files

Fix qgis_analysis build when Qt::PrintSupport isn't available (ie iOs) (

#39869)

Disable:
- QgsLayoutAtlasToImageAlgorithm
- QgsLayoutAtlasToPdfAlgorithm
- QgsLayoutToImageAlgorithm
- QgsLayoutToPdfAlgorithm
  • Loading branch information
OlivierLDff committed Nov 10, 2020
1 parent 48be2de commit ccdff23dbe46d36b29e29ca8991122bb67b03999
@@ -95,10 +95,6 @@ SET(QGIS_ANALYSIS_SRCS
processing/qgsalgorithmjoinbynearest.cpp
processing/qgsalgorithmjoinwithlines.cpp
processing/qgsalgorithmkmeansclustering.cpp
processing/qgsalgorithmlayoutatlastoimage.cpp
processing/qgsalgorithmlayoutatlastopdf.cpp
processing/qgsalgorithmlayouttoimage.cpp
processing/qgsalgorithmlayouttopdf.cpp
processing/qgsalgorithmlinedensity.cpp
processing/qgsalgorithmlineintersection.cpp
processing/qgsalgorithmlinesubstring.cpp
@@ -374,6 +370,16 @@ SET(QGIS_ANALYSIS_HDRS
vector/qgszonalstatistics.h
)

IF(TARGET Qt5::PrintSupport)
SET(QGIS_ANALYSIS_SRCS ${QGIS_ANALYSIS_SRCS}

processing/qgsalgorithmlayoutatlastoimage.cpp
processing/qgsalgorithmlayoutatlastopdf.cpp
processing/qgsalgorithmlayouttoimage.cpp
processing/qgsalgorithmlayouttopdf.cpp
)
ENDIF()

FIND_PACKAGE(EXIV2 REQUIRED)

INCLUDE_DIRECTORIES(SYSTEM ${SPATIALITE_INCLUDE_DIR})
@@ -91,10 +91,12 @@
#include "qgsalgorithminterpolatepoint.h"
#include "qgsalgorithmintersection.h"
#include "qgsalgorithmkmeansclustering.h"
#ifndef QT_NO_PRINTER
#include "qgsalgorithmlayoutatlastoimage.h"
#include "qgsalgorithmlayoutatlastopdf.h"
#include "qgsalgorithmlayouttoimage.h"
#include "qgsalgorithmlayouttopdf.h"
#endif
#include "qgsalgorithmlinedensity.h"
#include "qgsalgorithmlineintersection.h"
#include "qgsalgorithmlinesubstring.h"
@@ -330,10 +332,12 @@ void QgsNativeAlgorithms::loadAlgorithms()
addAlgorithm( new QgsKMeansClusteringAlgorithm() );
addAlgorithm( new QgsLayerToBookmarksAlgorithm() );
addAlgorithm( new QgsLayoutMapExtentToLayerAlgorithm() );
#ifndef QT_NO_PRINTER
addAlgorithm( new QgsLayoutAtlasToImageAlgorithm() );
addAlgorithm( new QgsLayoutAtlasToPdfAlgorithm() );
addAlgorithm( new QgsLayoutToImageAlgorithm() );
addAlgorithm( new QgsLayoutToPdfAlgorithm() );
#endif
addAlgorithm( new QgsLineDensityAlgorithm() );
addAlgorithm( new QgsLineIntersectionAlgorithm() );
addAlgorithm( new QgsLineSubstringAlgorithm() );
@@ -143,10 +143,13 @@ class TestQgsProcessingAlgs: public QObject

void saveLog();
void setProjectVariable();

#ifndef QT_NO_PRINTER
void exportLayoutPdf();
void exportLayoutPng();
void exportAtlasLayoutPdf();
void exportAtlasLayoutPng();
#endif

void tinMeshCreation();
void exportMeshVertices();
@@ -4597,6 +4600,7 @@ void TestQgsProcessingAlgs::setProjectVariable()
QCOMPARE( scope->variable( QStringLiteral( "my_var" ) ).toInt(), 13 );
}

#ifndef QT_NO_PRINTER
void TestQgsProcessingAlgs::exportLayoutPdf()
{
QgsProject p;
@@ -4793,6 +4797,7 @@ void TestQgsProcessingAlgs::exportAtlasLayoutPng()
QVERIFY( QFile::exists( QDir::tempPath() + "/my_atlas/custom_10.png" ) );
QVERIFY( imageCheck( "export_atlas_custom_layers", QDir::tempPath() + "/my_atlas/custom_1.png" ) );
}
#endif

void TestQgsProcessingAlgs::tinMeshCreation()
{

0 comments on commit ccdff23

Please sign in to comment.
You can’t perform that action at this time.