Permalink
Browse files

more plugin work

  • Loading branch information...
1 parent 0472b87 commit 016f94e2840b61054b2d57d73c18a33592fe1529 @hobu hobu committed Nov 9, 2012
Showing with 49 additions and 13 deletions.
  1. +6 −0 CMakeLists.txt
  2. +2 −2 include/pdal/drivers/pcd/Writer.hpp
  3. +10 −1 pdal_defines.h.in
  4. +23 −9 src/CMakeLists.txt
  5. +7 −0 src/StageFactory.cpp
  6. +1 −1 src/drivers/pcd/Writer.cpp
View
@@ -485,6 +485,12 @@ if(WITH_PYTHON)
endif()
endif()
+set (USE_PDAL_PLUGIN_PCD FALSE CACHE BOOL "Build the PCD driver as a plugin rather than embedding")
+set (USE_PDAL_PLUGIN_TEXT FALSE CACHE BOOL "Build the text driver as a plugin rather than embedding")
+set (USE_PDAL_PLUGIN_SOCI FALSE CACHE BOOL "Build the soci driver as a plugin rather than embedding")
+set (USE_PDAL_PLUGIN_OCI FALSE CACHE BOOL "Build the oci driver as a plugin rather than embedding")
+set (USE_PDAL_PLUGIN_MRSID FALSE CACHE BOOL "Build the MrSID driver as a plugin rather than embedding")
+set (USE_PDAL_PLUGIN_CARIS FALSE CACHE BOOL "Build the Caris driver as a plugin rather than embedding")
#------------------------------------------------------------------------------
# installation path settings
@@ -61,10 +61,10 @@ class pcd_driver_error : public pdal_error
{}
};
-#ifdef USE_PDAL_PLUGIN_TEXT
+#ifdef USE_PDAL_PLUGIN_PCD
PDAL_C_START
-PDAL_DLL void PDALRegister_writer_text(void* factory);
+PDAL_DLL void PDALRegister_writer_pcd(void* factory);
PDAL_C_END
#endif
View
@@ -29,7 +29,6 @@
#cmakedefine PDAL_HAVE_GDAL
#cmakedefine PDAL_HAVE_FLANN
#cmakedefine PDAL_HAVE_LASZIP
-#cmakedefine PDAL_HAVE_LIBLAS
#cmakedefine PDAL_HAVE_LIBXML2
#cmakedefine PDAL_HAVE_LIBGEOTIFF
#cmakedefine PDAL_HAVE_MRSID
@@ -38,6 +37,16 @@
#cmakedefine PDAL_HAVE_PYTHON
#cmakedefine PDAL_HAVE_SOCI
+/*
+ * plugins
+ */
+#cmakedefine USE_PDAL_PLUGIN_PCD
+#cmakedefine USE_PDAL_PLUGIN_TEXT
+#cmakedefine USE_PDAL_PLUGIN_SOCI
+#cmakedefine USE_PDAL_PLUGIN_OCI
+#cmakedefine USE_PDAL_PLUGIN_MRSID
+#cmakedefine USE_PDAL_PLUGIN_CARIS
+
/*
* platform endianness
View
@@ -388,8 +388,10 @@ set (PDAL_DRIVERS_PCD_CPP
${PDAL_PCD_SRC}/Writer.cpp
)
+if (NOT USE_PDAL_PLUGIN_PCD)
list (APPEND PDAL_CPP ${PDAL_DRIVERS_PCD_CPP} )
list (APPEND PDAL_HPP ${PDAL_DRIVERS_PCD_HPP} )
+endif()
#
# drivers/soci
@@ -410,8 +412,10 @@ set (PDAL_DRIVERS_SOCI_CPP
)
if (SOCI_FOUND)
- list (APPEND PDAL_CPP ${PDAL_DRIVERS_SOCI_CPP} )
- list (APPEND PDAL_HPP ${PDAL_DRIVERS_SOCI_HPP} )
+ if (NOT USE_PDAL_PLUGIN_SOCI)
+ list (APPEND PDAL_CPP ${PDAL_DRIVERS_SOCI_CPP} )
+ list (APPEND PDAL_HPP ${PDAL_DRIVERS_SOCI_HPP} )
+ endif()
endif()
@@ -637,13 +641,23 @@ if (APPLE)
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
endif()
-# set(PDAL_CSV_WRITER_NAME pdal_plugin_writer_text)
-# set(PDAL_CSV_WRITER_SRC "./drivers/text/Writer.cpp")
-# add_library(${PDAL_CSV_WRITER_NAME} SHARED ${PDAL_CSV_WRITER_SRC})
-# target_link_libraries(${PDAL_CSV_WRITER_NAME}
-# ${PDAL_LIB_NAME})
-# set_target_properties(${PDAL_CSV_WRITER_NAME}
-# PROPERTIES SOVERSION "${PDAL_LIB_SOVERSION}" )
+
+
+
+if (USE_PDAL_PLUGIN_PCD)
+ set(PDAL_PCD_WRITER_LIB_NAME pdal_plugin_writer_pcd)
+ add_library(${PDAL_PCD_WRITER_LIB_NAME} SHARED ${PDAL_PCD_SRC})
+ target_link_libraries(${PDAL_PCD_WRITER_LIB_NAME}
+ ${PDAL_LIB_NAME})
+ set_target_properties(${PDAL_PCD_WRITER_LIB_NAME}
+ PROPERTIES SOVERSION "${PDAL_LIB_SOVERSION}" )
+ if (APPLE)
+ set_target_properties(
+ ${PDAL_PCD_WRITER_LIB_NAME}
+ PROPERTIES
+ INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+ endif()
+endif()
###############################################################################
# Targets installation
@@ -190,7 +190,11 @@ MAKE_MULTIFILTER_CREATOR(Mosaic, pdal::filters::Mosaic)
MAKE_WRITER_CREATOR(FauxWriter, pdal::drivers::faux::Writer)
MAKE_WRITER_CREATOR(LasWriter, pdal::drivers::las::Writer)
MAKE_WRITER_CREATOR(TextWriter, pdal::drivers::text::Writer)
+
+#ifndef USE_PDAL_PLUGIN_PCD
MAKE_WRITER_CREATOR(PCDWriter, pdal::drivers::pcd::Writer)
+#endif
+
#ifdef PDAL_HAVE_ORACLE
MAKE_WRITER_CREATOR(OciWriter, pdal::drivers::oci::Writer)
#endif
@@ -457,7 +461,10 @@ void StageFactory::registerKnownWriters()
REGISTER_WRITER(FauxWriter, pdal::drivers::faux::Writer);
REGISTER_WRITER(LasWriter, pdal::drivers::las::Writer);
REGISTER_WRITER(TextWriter, pdal::drivers::text::Writer);
+#ifndef USE_PDAL_PLUGIN_PCD
REGISTER_WRITER(PCDWriter, pdal::drivers::pcd::Writer);
+#endif
+
#ifdef PDAL_HAVE_ORACLE
REGISTER_WRITER(OciWriter, pdal::drivers::oci::Writer);
#endif
@@ -47,7 +47,7 @@ PDAL_C_START
PDAL_DLL void PDALRegister_writer_pcd(void* factory)
{
pdal::StageFactory& f = *(pdal::StageFactory*) factory;
- f.registerWriter(pdal::drivers::pcd::Writer::s_getName(), createTextWriter);
+ f.registerWriter(pdal::drivers::pcd::Writer::s_getName(), createPCDWriter);
}
PDAL_C_END

0 comments on commit 016f94e

Please sign in to comment.