Skip to content

Commit

Permalink
Rename HAVE_PDAL as HAVE_PDAL_QGIS
Browse files Browse the repository at this point in the history
The grass public headers define HAVE_PDAL if grass is built with
PDAL support, so this macro gets redefined on GRASS enabled builds.
Switch to using HAVE_PDAL_QGIS to avoid the conflict.
  • Loading branch information
nyalldawson committed Feb 8, 2022
1 parent 1a65915 commit e85df91
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -284,7 +284,7 @@ if(WITH_CORE)

set (WITH_PDAL FALSE CACHE BOOL "Determines whether PDAL support should be built")
if(WITH_PDAL)
set(HAVE_PDAL TRUE)
set(HAVE_PDAL_QGIS TRUE) # note -- we can't use HAVE_PDAL here as the grass public headers redefine this!
endif()

set (WITH_EPT TRUE CACHE BOOL "Determines whether Entwine Point Cloud (EPT) support should be built")
Expand Down Expand Up @@ -434,7 +434,7 @@ if(WITH_CORE)
find_package(PDAL) # PDAL provider
endif()
if (PDAL_FOUND)
set(HAVE_PDAL TRUE) # used in qgsconfig.h
set(HAVE_PDAL_QGIS TRUE) # used in qgsconfig.h
endif()

#############################################################
Expand Down
2 changes: 1 addition & 1 deletion cmake_templates/qgsconfig.h.in
Expand Up @@ -98,7 +98,7 @@

#cmakedefine HAVE_EPT

#cmakedefine HAVE_PDAL
#cmakedefine HAVE_PDAL_QGIS
#define PDAL_VERSION "${PDAL_VERSION}"
#define PDAL_VERSION_MAJOR_INT ${PDAL_VERSION_MAJOR}
#define PDAL_VERSION_MINOR_INT ${PDAL_VERSION_MINOR}
Expand Down
4 changes: 2 additions & 2 deletions src/app/CMakeLists.txt
Expand Up @@ -431,7 +431,7 @@ if(HAVE_OPENCL)
include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS})
endif()

if (HAVE_PDAL)
if (WITH_PDAL)
include_directories(SYSTEM ${PDAL_INCLUDE_DIR})
if(MSVC)
add_definitions(-DWIN32_LEAN_AND_MEAN)
Expand Down Expand Up @@ -618,7 +618,7 @@ if (POSTGRES_FOUND)
target_link_libraries (qgis_app ${POSTGRES_LIBRARY})
endif()

if (HAVE_PDAL)
if (WITH_PDAL)
target_link_libraries(qgis_app ${PDAL_LIBRARIES})
endif()

Expand Down
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -455,7 +455,7 @@ Q_GUI_EXPORT extern int qt_defaultDpiX();
#include <gdal_version.h>
#include <proj.h>

#ifdef HAVE_PDAL
#ifdef HAVE_PDAL_QGIS
#include <pdal/pdal.hpp>
#endif

Expand Down Expand Up @@ -5512,7 +5512,7 @@ void QgisApp::about()
versionString += QLatin1String( "</tr><tr>" );

// PDAL
#ifdef HAVE_PDAL
#ifdef HAVE_PDAL_QGIS
const QString pdalVersionCompiled { PDAL_VERSION };
#if PDAL_VERSION_MAJOR_INT > 1 || (PDAL_VERSION_MAJOR_INT == 1 && PDAL_VERSION_MINOR_INT >= 7)
const QString pdalVersionRunningRaw { QString::fromStdString( pdal::Config::fullVersionString() ) };
Expand Down
4 changes: 2 additions & 2 deletions src/core/CMakeLists.txt
Expand Up @@ -1855,7 +1855,7 @@ if (${QT_VERSION_BASE}Positioning_FOUND)
)
endif()

if (HAVE_PDAL)
if (WITH_PDAL)
include_directories(SYSTEM
${PDAL_INCLUDE_DIR}
)
Expand Down Expand Up @@ -2155,7 +2155,7 @@ if (WITH_EPT)
)
endif()

if (HAVE_PDAL)
if (WITH_PDAL)
target_link_libraries(qgis_core
${PDAL_LIBRARIES}
)
Expand Down
4 changes: 2 additions & 2 deletions src/core/processing/qgsprocessingfeedback.cpp
Expand Up @@ -22,7 +22,7 @@
#include <gdal_version.h>
#include <proj.h>

#ifdef HAVE_PDAL
#ifdef HAVE_PDAL_QGIS
#include <pdal/pdal.hpp>
#endif

Expand Down Expand Up @@ -125,7 +125,7 @@ void QgsProcessingFeedback::pushVersionInfo( const QgsProcessingProvider *provid
const PJ_INFO info = proj_info();
pushDebugInfo( tr( "PROJ version: %1" ).arg( info.release ) );

#ifdef HAVE_PDAL
#ifdef HAVE_PDAL_QGIS
#if PDAL_VERSION_MAJOR_INT > 1 || (PDAL_VERSION_MAJOR_INT == 1 && PDAL_VERSION_MINOR_INT >= 7)
pushDebugInfo( tr( "PDAL version: %1" ).arg( QString::fromStdString( pdal::Config::fullVersionString() ) ) );
#else
Expand Down
2 changes: 1 addition & 1 deletion tests/src/analysis/testqgsprocessing.cpp
Expand Up @@ -10495,7 +10495,7 @@ void TestQgsProcessing::parameterPointCloudLayer()

QVERIFY( !def->createFileFilter().contains( QStringLiteral( "*.shp" ) ) );
QVERIFY( !def->createFileFilter().contains( QStringLiteral( "*.tif" ) ) );
#ifdef HAVE_PDAL
#ifdef HAVE_PDAL_QGIS
QVERIFY( def->createFileFilter().contains( QStringLiteral( "*.las" ) ) );
#endif
QVERIFY( def->createFileFilter().contains( QStringLiteral( "*.*" ) ) );
Expand Down

0 comments on commit e85df91

Please sign in to comment.