From 4c81d0d1aa9980ce4d1fe2390cfc4771bd771896 Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Thu, 3 Jan 2013 08:53:25 -0800 Subject: [PATCH] fix up building in non-GDAL situations --- src/CMakeLists.txt | 2 ++ src/GlobalEnvironment.cpp | 4 ++-- src/filters/Colorization.cpp | 9 ++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fe9568a5ba..a5ec139885 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -593,6 +593,8 @@ if (WIN32) else() target_link_libraries(${APPS_CPP_DEPENDENCIES} ${PDAL_LIB_NAME} + ${CMAKE_THREAD_LIBS_INIT} + ${CMAKE_DL_LIBS} ${TIFF_LIBRARY} ${MRSID_LIBRARY} ${GEOTIFF_LIBRARY} diff --git a/src/GlobalEnvironment.cpp b/src/GlobalEnvironment.cpp index fd382405b0..4de3a3fd0d 100644 --- a/src/GlobalEnvironment.cpp +++ b/src/GlobalEnvironment.cpp @@ -197,10 +197,10 @@ plang::PythonEnvironment& GlobalEnvironment::getPythonEnvironment() pdal::gdal::GlobalDebug* GlobalEnvironment::getGDALDebug() { getGDALEnvironment(); - +#ifdef PDAL_HAVE_GDAL if (m_gdal_debug == 0) m_gdal_debug = new pdal::gdal::GlobalDebug(); - +#endif return m_gdal_debug; } diff --git a/src/filters/Colorization.cpp b/src/filters/Colorization.cpp index c5cd185196..010c5f5953 100644 --- a/src/filters/Colorization.cpp +++ b/src/filters/Colorization.cpp @@ -205,6 +205,7 @@ Colorization::Colorization(const pdal::filters::Colorization& filter, PointBuffe m_forward_transform.assign(0.0); m_inverse_transform.assign(0.0); +#ifdef PDAL_HAVE_GDAL std::string filename = filter.getOptions().getValueOrThrow("raster"); filter.log()->get(logDEBUG) << "Using " << filename << " for raster" << std::endl; @@ -219,18 +220,20 @@ Colorization::Colorization(const pdal::filters::Colorization& filter, PointBuffe GDALInvGeoTransform(&(m_forward_transform.front()), &(m_inverse_transform.front())); - +#endif + return; } Colorization::~Colorization() { - +#ifdef PDAL_HAVE_GDAL if (m_ds != 0) { GDALClose(m_ds); m_ds = 0; } +#endif } @@ -273,7 +276,7 @@ bool Colorization::getPixelAndLinePosition(double x, boost::array const& inverse, boost::int32_t& pixel, boost::int32_t& line, - GDALDatasetH ds) + void* ds) { #ifdef PDAL_HAVE_GDAL pixel = (boost::int32_t) std::floor(