[Liblas-commits] hg-main-tree: excise the libLAS requirement from PDAL. No need t...

liblas-commits at liblas.org liblas-commits at liblas.org
Sun Aug 14 23:06:37 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/91c4509b5ec5
changeset: 1086:91c4509b5ec5
user:      Howard Butler <hobu.inc at gmail.com>
date:      Sun Aug 14 22:06:34 2011 -0500
description:
excise the libLAS requirement from PDAL. No need to have libLAS to be able to build/use PDAL anymore

diffstat:

 CMakeLists.txt               |  10 +++++-----
 apps/pc2pc.cpp               |   4 ++++
 apps/pcinfo.cpp              |   7 +++++++
 src/CMakeLists.txt           |   3 ++-
 src/PipelineManager.cpp      |   5 -----
 src/PipelineReader.cpp       |   5 -----
 src/PipelineWriter.cpp       |   5 -----
 src/StageFactory.cpp         |  21 +++++++++++++++++++++
 src/drivers/oci/Iterator.cpp |   2 --
 test/unit/CMakeLists.txt     |   9 +++++++--
 test/unit/ChipperTest.cpp    |   7 +++----
 11 files changed, 49 insertions(+), 29 deletions(-)

diffs (293 lines):

diff -r 5d97ff43883b -r 91c4509b5ec5 CMakeLists.txt
--- a/CMakeLists.txt	Sun Aug 14 09:47:06 2011 -0500
+++ b/CMakeLists.txt	Sun Aug 14 22:06:34 2011 -0500
@@ -338,7 +338,7 @@
 endif()
 
 # LIBLAS support - optional, default=OFF
-set(WITH_LIBLAS TRUE CACHE BOOL "Choose if libLAS support should be built")
+set(WITH_LIBLAS FALSE CACHE BOOL "Choose if libLAS support should be built")
 set(WITH_STATIC_LIBLAS FALSE CACHE BOOL "Choose if libLAS should be statically linked")
 mark_as_advanced(WITH_STATIC_LIBLAS)
 
@@ -354,10 +354,10 @@
     endif()
 endif()
 
-if (NOT LIBLAS_FOUND)
-  message(FATAL_ERROR
-    "PDAL currently requires a working libLAS installation 1.6.0 or greater")
-endif()
+# if (NOT LIBLAS_FOUND)
+#   message(FATAL_ERROR
+#     "PDAL currently requires a working libLAS installation 1.6.0 or greater")
+# endif()
 
 # MrSID/LiDAR support - optiona, default=OFF
 set(WITH_MRSID FALSE CACHE BOOL "Choose if MrSID/LiDAR support should be built")
diff -r 5d97ff43883b -r 91c4509b5ec5 apps/pc2pc.cpp
--- a/apps/pc2pc.cpp	Sun Aug 14 09:47:06 2011 -0500
+++ b/apps/pc2pc.cpp	Sun Aug 14 22:06:34 2011 -0500
@@ -34,8 +34,10 @@
 #include <pdal/filters/CacheFilter.hpp>
 #include <pdal/filters/ByteSwapFilter.hpp>
 
+#ifdef PDAL_HAVE_LIBLAS
 #include <pdal/drivers/liblas/Writer.hpp>
 #include <pdal/drivers/liblas/Reader.hpp>
+#endif
 
 #ifdef PDAL_HAVE_ORACLE
 #include <pdal/drivers/oci/Writer.hpp>
@@ -299,6 +301,7 @@
 
     else
     {
+#ifdef PDAL_HAVE_LIBLAS
         pdal::drivers::liblas::LiblasReader reader(m_inputFile);
     
         const boost::uint64_t numPoints = reader.getNumPoints();
@@ -312,6 +315,7 @@
         writer.initialize();
 
         writer.write(numPoints);
+#endif
     }
 
     FileUtils::closeFile(ofs);
diff -r 5d97ff43883b -r 91c4509b5ec5 apps/pcinfo.cpp
--- a/apps/pcinfo.cpp	Sun Aug 14 09:47:06 2011 -0500
+++ b/apps/pcinfo.cpp	Sun Aug 14 22:06:34 2011 -0500
@@ -11,8 +11,13 @@
 
 
 #include <pdal/drivers/las/Reader.hpp>
+
+#ifdef PDAL_HAVE_LIBLAS
 #include <pdal/drivers/liblas/Reader.hpp>
+#endif
+
 #include <pdal/FileUtils.hpp>
+
 #ifdef PDAL_HAVE_MRSID
 #include <pdal/drivers/mrsid/Reader.hpp>
 #endif
@@ -92,10 +97,12 @@
             {
                 reader = new pdal::drivers::las::LasReader(m_inputFile);
             }
+#ifdef PDAL_HAVE_LIBLAS
             else
             {
                 reader = new pdal::drivers::liblas::LiblasReader(m_inputFile);
             }
+#endif
         }
 #ifdef PDAL_HAVE_MRSID
         else if (!m_inputFile.substr(ext).compare("sid"))
diff -r 5d97ff43883b -r 91c4509b5ec5 src/CMakeLists.txt
--- a/src/CMakeLists.txt	Sun Aug 14 09:47:06 2011 -0500
+++ b/src/CMakeLists.txt	Sun Aug 14 22:06:34 2011 -0500
@@ -175,6 +175,7 @@
 set(PDAL_LIBLAS_HEADERS ${PDAL_HEADERS_DIR}/${PDAL_LIBLAS_PATH})
 set(PDAL_LIBLAS_SRC ${PROJECT_SOURCE_DIR}/src/${PDAL_LIBLAS_PATH})
 
+if (LIBLAS_FOUND)
 set (PDAL_DRIVERS_LIBLAS_HPP
   ${PDAL_LIBLAS_HEADERS}/Iterator.hpp
   ${PDAL_LIBLAS_HEADERS}/Reader.hpp
@@ -186,7 +187,7 @@
   ${PDAL_LIBLAS_SRC}/Reader.cpp
   ${PDAL_LIBLAS_SRC}/Writer.cpp
 )
-
+endif()
 list (APPEND PDAL_CPP ${PDAL_DRIVERS_LIBLAS_CPP} )
 list (APPEND PDAL_HPP ${PDAL_DRIVERS_LIBLAS_HPP} )
 
diff -r 5d97ff43883b -r 91c4509b5ec5 src/PipelineManager.cpp
--- a/src/PipelineManager.cpp	Sun Aug 14 09:47:06 2011 -0500
+++ b/src/PipelineManager.cpp	Sun Aug 14 22:06:34 2011 -0500
@@ -39,11 +39,6 @@
 #include <pdal/Reader.hpp>
 #include <pdal/Writer.hpp>
 
-#include <pdal/drivers/las/Reader.hpp>
-#include <pdal/drivers/las/Writer.hpp>
-#include <pdal/drivers/liblas/Reader.hpp>
-#include <pdal/drivers/liblas/Writer.hpp>
-
 #include <boost/property_tree/xml_parser.hpp>
 #include <boost/optional.hpp>
 
diff -r 5d97ff43883b -r 91c4509b5ec5 src/PipelineReader.cpp
--- a/src/PipelineReader.cpp	Sun Aug 14 09:47:06 2011 -0500
+++ b/src/PipelineReader.cpp	Sun Aug 14 22:06:34 2011 -0500
@@ -42,11 +42,6 @@
 #include <pdal/Options.hpp>
 #include <pdal/FileUtils.hpp>
 
-#include <pdal/drivers/las/Reader.hpp>
-#include <pdal/drivers/las/Writer.hpp>
-#include <pdal/drivers/liblas/Reader.hpp>
-#include <pdal/drivers/liblas/Writer.hpp>
-
 #include <boost/property_tree/xml_parser.hpp>
 #include <boost/optional.hpp>
 #include <boost/filesystem.hpp>
diff -r 5d97ff43883b -r 91c4509b5ec5 src/PipelineWriter.cpp
--- a/src/PipelineWriter.cpp	Sun Aug 14 09:47:06 2011 -0500
+++ b/src/PipelineWriter.cpp	Sun Aug 14 22:06:34 2011 -0500
@@ -40,11 +40,6 @@
 #include <pdal/Writer.hpp>
 #include <pdal/PipelineManager.hpp>
 
-#include <pdal/drivers/las/Reader.hpp>
-#include <pdal/drivers/las/Writer.hpp>
-#include <pdal/drivers/liblas/Reader.hpp>
-#include <pdal/drivers/liblas/Writer.hpp>
-
 #include <boost/property_tree/xml_parser.hpp>
 #include <boost/optional.hpp>
 
diff -r 5d97ff43883b -r 91c4509b5ec5 src/StageFactory.cpp
--- a/src/StageFactory.cpp	Sun Aug 14 09:47:06 2011 -0500
+++ b/src/StageFactory.cpp	Sun Aug 14 22:06:34 2011 -0500
@@ -41,7 +41,11 @@
 
 #include <pdal/drivers/faux/Reader.hpp>
 #include <pdal/drivers/las/Reader.hpp>
+
+#ifdef PDAL_HAVE_LIBLAS
 #include <pdal/drivers/liblas/Reader.hpp>
+#endif
+
 #ifdef PDAL_HAVE_ORACLE
 #include <pdal/drivers/oci/Reader.hpp>
 #endif
@@ -50,7 +54,11 @@
 
 #include <pdal/drivers/faux/Writer.hpp>
 #include <pdal/drivers/las/Writer.hpp>
+
+#ifdef PDAL_HAVE_LIBLAS
 #include <pdal/drivers/liblas/Writer.hpp>
+#endif
+
 #ifdef PDAL_HAVE_ORACLE
 #include <pdal/drivers/oci/Writer.hpp>
 #endif
@@ -87,10 +95,15 @@
 
 MAKE_READER_CREATOR(FauxReader, pdal::drivers::faux::Reader)
 MAKE_READER_CREATOR(LasReader, pdal::drivers::las::LasReader)
+
+#ifdef PDAL_HAVE_LIBLAS
 MAKE_READER_CREATOR(LiblasReader, pdal::drivers::liblas::LiblasReader)
+#endif
+
 #ifdef PDAL_HAVE_ORACLE
 MAKE_READER_CREATOR(OciReader, pdal::drivers::oci::Reader)
 #endif
+
 MAKE_READER_CREATOR(QfitReader, pdal::drivers::qfit::Reader)
 MAKE_READER_CREATOR(TerrasolidReader, pdal::drivers::terrasolid::Reader)
 
@@ -108,7 +121,11 @@
 
 MAKE_WRITER_CREATOR(FauxWriter, pdal::drivers::faux::Writer)
 MAKE_WRITER_CREATOR(LasWriter, pdal::drivers::las::LasWriter)
+
+#ifdef PDAL_HAVE_LIBLAS
 MAKE_WRITER_CREATOR(LiblasWriter, pdal::drivers::liblas::LiblasWriter)
+#endif
+
 #ifdef PDAL_HAVE_ORACLE
 MAKE_WRITER_CREATOR(OciWriter, pdal::drivers::oci::Writer)
 #endif
@@ -249,7 +266,9 @@
 
     REGISTER_READER(FauxReader, pdal::drivers::faux::Reader);
     REGISTER_READER(LasReader, pdal::drivers::las::LasReader);
+#ifdef PDAL_HAVE_LIBLAS
     REGISTER_READER(LiblasReader, pdal::drivers::liblas::LiblasReader);
+#endif
 #ifdef PDAL_HAVE_ORACLE
     REGISTER_READER(OciReader, pdal::drivers::oci::Reader);
 #endif
@@ -291,7 +310,9 @@
 
     REGISTER_WRITER(FauxWriter, pdal::drivers::faux::Writer);
     REGISTER_WRITER(LasWriter, pdal::drivers::las::LasWriter);
+#ifdef PDAL_HAVE_LIBLAS
     REGISTER_WRITER(LiblasWriter, pdal::drivers::liblas::LiblasWriter);
+#endif
 #ifdef PDAL_HAVE_ORACLE
     REGISTER_WRITER(OciWriter, pdal::drivers::oci::Writer);
 #endif
diff -r 5d97ff43883b -r 91c4509b5ec5 src/drivers/oci/Iterator.cpp
--- a/src/drivers/oci/Iterator.cpp	Sun Aug 14 09:47:06 2011 -0500
+++ b/src/drivers/oci/Iterator.cpp	Sun Aug 14 22:06:34 2011 -0500
@@ -34,8 +34,6 @@
 
 #include <pdal/drivers/oci/Iterator.hpp>
 
-#include <liblas/factory.hpp>
-
 #include <pdal/exceptions.hpp>
 #include <pdal/PointBuffer.hpp>
 #include <pdal/drivers/oci/Reader.hpp>
diff -r 5d97ff43883b -r 91c4509b5ec5 test/unit/CMakeLists.txt
--- a/test/unit/CMakeLists.txt	Sun Aug 14 09:47:06 2011 -0500
+++ b/test/unit/CMakeLists.txt	Sun Aug 14 22:06:34 2011 -0500
@@ -11,6 +11,12 @@
 SET (PDAL_UNITTEST_XMLSCHEMA_TEST XMLSchemaTest.cpp)
 endif()
 
+if (LIBLAS_FOUND)
+    SET(LIBLAS_TESTS LiblasReaderTest.cpp
+                        LiblasWriterTest.cpp 
+                        )
+endif()
+
 SET(PDAL_UNITTEST_TEST_SRC
     pc2pcTest.cpp
     pcinfoTest.cpp
@@ -31,8 +37,7 @@
     FileUtilsTest.cpp
     LasReaderTest.cpp
     LasWriterTest.cpp
-    LiblasReaderTest.cpp
-    LiblasWriterTest.cpp
+    ${LIBLAS_TESTS}
     MosaicFilterTest.cpp
     OptionsTest.cpp
     PipelineManagerTest.cpp
diff -r 5d97ff43883b -r 91c4509b5ec5 test/unit/ChipperTest.cpp
--- a/test/unit/ChipperTest.cpp	Sun Aug 14 09:47:06 2011 -0500
+++ b/test/unit/ChipperTest.cpp	Sun Aug 14 22:06:34 2011 -0500
@@ -36,21 +36,20 @@
 #include <boost/cstdint.hpp>
 
 #include <pdal/filters/Chipper.hpp>
-#include <pdal/drivers/liblas/Writer.hpp>
-#include <pdal/drivers/liblas/Reader.hpp>
+#include <pdal/drivers/las/Writer.hpp>
+#include <pdal/drivers/las/Reader.hpp>
 #include <pdal/Options.hpp>
 
 #include "Support.hpp"
 
 using namespace pdal;
-using namespace pdal::drivers::liblas;
 
 BOOST_AUTO_TEST_SUITE(ChipperTest)
 
 
 BOOST_AUTO_TEST_CASE(test_construction)
 {
-    LiblasReader reader(Support::datapath("1.2-with-color.las"));
+    pdal::drivers::las::LasReader reader(Support::datapath("1.2-with-color.las"));
 
     {
         // need to scope the writer, so that's it dtor can use the stream


More information about the Liblas-commits mailing list