mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-22 00:06:12 -05:00
able to build without zstd and lazperf
This commit is contained in:
parent
8536c564fb
commit
bb5b625bc4
@ -351,7 +351,13 @@ IF(WITH_CORE)
|
||||
MESSAGE(STATUS "Found zlib: ${ZLIB_LIBRARIES}")
|
||||
|
||||
FIND_PACKAGE(ZSTD REQUIRED) # for decompression of point clouds
|
||||
IF (ZSTD_FOUND)
|
||||
SET(HAVE_ZSTD TRUE) # used in qgsconfig.h
|
||||
ENDIF (ZSTD_FOUND)
|
||||
FIND_PACKAGE(LazPerf REQUIRED) # for decompression of point clouds
|
||||
IF (LazPerf_FOUND)
|
||||
SET(HAVE_LAZPERF TRUE) # used in qgsconfig.h
|
||||
ENDIF (LazPerf_FOUND)
|
||||
|
||||
# optional
|
||||
IF (WITH_POSTGRESQL)
|
||||
@ -380,6 +386,7 @@ IF(WITH_CORE)
|
||||
ELSE (WITH_QTWEBKIT)
|
||||
MESSAGE(STATUS "Qt WebKit support DISABLED.")
|
||||
ENDIF(WITH_QTWEBKIT)
|
||||
|
||||
#############################################################
|
||||
# search for Qt5
|
||||
SET(QT_MIN_VERSION 5.9.0)
|
||||
|
@ -76,5 +76,9 @@
|
||||
|
||||
#cmakedefine HAVE_STATIC_PROVIDERS
|
||||
|
||||
#cmakedefine HAVE_ZSTD
|
||||
|
||||
#cmakedefine HAVE_LAZPERF
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -18,13 +18,19 @@
|
||||
#include "qgseptdecoder.h"
|
||||
#include "qgseptpointcloudindex.h"
|
||||
#include "qgsvector3d.h"
|
||||
#include "qgsconfig.h"
|
||||
|
||||
#include <zstd.h>
|
||||
#include <QFile>
|
||||
#include <iostream>
|
||||
|
||||
#if defined ( HAVE_ZSTD )
|
||||
#include <zstd.h>
|
||||
#endif
|
||||
|
||||
#if defined ( HAVE_LAZPERF )
|
||||
#include "laz-perf/io.hpp"
|
||||
#include "laz-perf/common/common.hpp"
|
||||
#endif
|
||||
|
||||
///@cond PRIVATE
|
||||
|
||||
@ -60,7 +66,7 @@ QVector<char> QgsEptDecoder::decompressBinaryClasses( const QString &filename, i
|
||||
Q_ASSERT( r );
|
||||
|
||||
int count = f.size() / pointRecordSize;
|
||||
QVector<char> classes(count);
|
||||
QVector<char> classes( count );
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
QByteArray bytes = f.read( pointRecordSize );
|
||||
@ -78,6 +84,8 @@ QVector<char> QgsEptDecoder::decompressBinaryClasses( const QString &filename, i
|
||||
|
||||
/* *************************************************************************************** */
|
||||
|
||||
#if defined(HAVE_ZSTD)
|
||||
|
||||
QByteArray decompressZtdStream( const QByteArray &dataCompressed )
|
||||
{
|
||||
// NOTE: this is very primitive implementation because we expect the uncompressed
|
||||
@ -135,8 +143,18 @@ QVector<qint32> QgsEptDecoder::decompressZStandard( const QString &filename, int
|
||||
return data;
|
||||
}
|
||||
|
||||
#else // defined(HAVE_ZSTD)
|
||||
QVector<qint32> QgsEptDecoder::decompressZStandard( const QString &filename, int pointRecordSize )
|
||||
{
|
||||
//TODO graceful error
|
||||
Q_ASSERT( false );
|
||||
}
|
||||
|
||||
#endif // defined(HAVE_ZSTD)
|
||||
|
||||
/* *************************************************************************************** */
|
||||
|
||||
#if defined ( HAVE_LAZPERF )
|
||||
QVector<qint32> QgsEptDecoder::decompressLaz( const QString &filename )
|
||||
{
|
||||
std::ifstream file( filename.toLatin1().constData(), std::ios::binary );
|
||||
@ -165,4 +183,12 @@ QVector<qint32> QgsEptDecoder::decompressLaz( const QString &filename )
|
||||
return data;
|
||||
}
|
||||
|
||||
#else // defined ( HAVE_LAZPERF )
|
||||
QVector<qint32> QgsEptDecoder::decompressLaz( const QString &filename )
|
||||
{
|
||||
//TODO graceful return and error message
|
||||
Q_ASSERT( false );
|
||||
}
|
||||
#endif
|
||||
|
||||
///@endcond
|
||||
|
Loading…
x
Reference in New Issue
Block a user