Skip to content

Commit

Permalink
Compilation fixes for Ubuntu 14.04.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Dec 8, 2015
1 parent e03f93c commit 6409766
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
10 changes: 2 additions & 8 deletions cmake/geos.cmake
Expand Up @@ -5,14 +5,8 @@ find_package(GEOS QUIET 3.3)
set_package_properties(GEOS PROPERTIES TYPE OPTIONAL
PURPOSE "Provides general purpose geometry support")
if (GEOS_FOUND)
find_file(GEOS_VERSION_H version.h "${GEOS_INCLUDE_DIR}/geos")
if ("${GEOS_VERSION_H}" STREQUAL "GEOS_VERSION_H-NOTFOUND")
set(GEOS_LIBRARY "")
set(GEOS_FOUND FALSE)
else()
include_directories("${GEOS_INCLUDE_DIR}")
set(PDAL_HAVE_GEOS 1)
endif()
include_directories("${GEOS_INCLUDE_DIR}")
set(PDAL_HAVE_GEOS 1)
else()
set(GEOS_LIBRARY "")
endif()
4 changes: 3 additions & 1 deletion include/pdal/Compression.hpp
Expand Up @@ -139,7 +139,9 @@ class TypedLazPerfBuf
{}

void putBytes(const unsigned char *b, size_t len)
{ m_buf.insert(m_buf.end(), (CTYPE *)b, (CTYPE *)(b + len)); }
{
m_buf.insert(m_buf.end(), (const CTYPE *)b, (const CTYPE *)(b + len));
}
void putByte(const unsigned char b)
{ m_buf.push_back((CTYPE)b); }
unsigned char getByte()
Expand Down
22 changes: 19 additions & 3 deletions include/pdal/Geometry.hpp
Expand Up @@ -96,7 +96,8 @@ static void finish()
namespace Geometry
{

static std::string smoothPolygon(const std::string& wkt, double tolerance, uint32_t precision, double area_threshold)
static std::string smoothPolygon(const std::string& wkt, double tolerance,
uint32_t precision, double area_threshold)
{
GEOSContextHandle_t env = init();

Expand Down Expand Up @@ -186,16 +187,31 @@ static double computeArea(const std::string& wkt)
finish();
return output;
}

} // namespace Geometry

#else

static std::string smoothPolygon(const std::string& wkt, double tolerance)
namespace Geometry
{

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
static std::string smoothPolygon(const std::string& wkt, double tolerance,
uint32_t precision, double area_threshold)
{
throw pdal_error("Can't call smoothPolygon. PDAL not built with GEOS.");
}

#endif
static double computeArea(const std::string& wkt)
{
throw pdal_error("Can't call computeArea. PDAL not built with GEOS.");
}
#pragma GCC diagnostic pop

} // namespace Geometry

#endif

} // namespace pdal

2 changes: 1 addition & 1 deletion src/pdal_config.cpp
Expand Up @@ -67,7 +67,7 @@
#endif

#ifdef PDAL_HAVE_GEOS
#include <geos/version.h>
#include <geos_c.h>
#endif

#ifdef PDAL_HAVE_HEXER
Expand Down

0 comments on commit 6409766

Please sign in to comment.