diff --git a/CMakeLists.txt b/CMakeLists.txt index 62536b0d64..94bcfd4648 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -269,15 +269,11 @@ endif(Boost_FOUND) #------------------------------------------------------------------------------ option(WITH_PCL "Choose if PCL support should be built" FALSE) -option(WITH_PCL_VISUALIZE "Choose if PCL was built with VTK support for visualization" FALSE) if(WITH_PCL) find_package(PCL 1.7) if(PCL_FOUND) include_directories(${PCL_INCLUDE_DIRS}) set(PDAL_HAVE_PCL 1) - if(WITH_PCL_VISUALIZE) - set(PDAL_HAVE_PCL_VISUALIZE 1) - endif() set(WITH_PCL_TEST 1) # PCL's configuration clobbers Boost find_package - do it again find_package(Boost 1.52 COMPONENTS program_options thread iostreams filesystem system unit_test_framework random) diff --git a/pdal_defines.h.in b/pdal_defines.h.in index 4275a0563d..694dbd954d 100644 --- a/pdal_defines.h.in +++ b/pdal_defines.h.in @@ -38,7 +38,6 @@ #cmakedefine PDAL_HAVE_ORACLE #cmakedefine PDAL_HAVE_P2G #cmakedefine PDAL_HAVE_PCL -#cmakedefine PDAL_HAVE_PCL_VISUALIZE #cmakedefine PDAL_HAVE_PYTHON #cmakedefine PDAL_HAVE_SQLITE #cmakedefine PDAL_HAVE_GREYHOUND diff --git a/plugins/pcl/CMakeLists.txt b/plugins/pcl/CMakeLists.txt index 48eedec473..95b19b4833 100644 --- a/plugins/pcl/CMakeLists.txt +++ b/plugins/pcl/CMakeLists.txt @@ -8,10 +8,9 @@ # This is because it's presence must still be known to several # downstream files (keep reading). # -# 2. pdal_defines.h.in is configured to broadcast PDAL_HAVE_PCL and -# PDAL_HAVE_PCL_VISUALIZATION. +# 2. pdal_defines.h.in is configured to broadcast PDAL_HAVE_PCL. # -# As with #1, these are used downstream. +# As with #1, this used downstream. # # 3. src/pdal_config.cpp sets the PCL version in getVersionString(), which # in turn requires pcl/pcl_config.h. @@ -22,18 +21,14 @@ # two point buffers. # # This is currently disabled (commented out), and should be somehow -# fully integrated as a plugin behavior. When enabled, this is done -# conditionally if PDAL_HAVE_PCL_VISUALIZATION is set. +# fully integrated as a plugin behavior. # -# 5. PCL is still linked into libpdalcpp via src/CMakeLists.txt. +# 5. PCL unit tests still live within main test directory. # -# Conditional on PDAL_HAVE_PCL. -# -# 6. PCL unit tests still live within main test directory. We should be -# able to move plugin tests to plugin directories without too much -# hassle. -# -# Conditional on PDAL_HAVE_PCL. +# We should be able to move plugin tests to plugin directories without +# too much hassle. PCL unit tests will pass with a warning if the PCL +# plugins are not installed in PDAL_DRIVER_PATH (just assumes you didn't +# intend to test with PCL support). # include_directories(${PROJECT_SOURCE_DIR}/include) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index afa1190b07..943cf83338 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -794,10 +794,6 @@ if (WITH_PYTHON) target_link_libraries(${PDAL_LIB_NAME} ${PDAL_LINKAGE} "${PYTHON_LIBRARY}") endif() -#if (PDAL_HAVE_PCL) -# target_link_libraries(${PDAL_LIB_NAME} ${PDAL_LINKAGE} ${PCL_LIBRARIES}) -#endif() - if (WITH_LIBXML2) target_link_libraries(${PDAL_LIB_NAME} ${PDAL_LINKAGE} ${LIBXML2_LIBRARIES}) endif() diff --git a/src/kernel/Kernel.cpp b/src/kernel/Kernel.cpp index e4f568945f..f427dfb037 100644 --- a/src/kernel/Kernel.cpp +++ b/src/kernel/Kernel.cpp @@ -46,13 +46,6 @@ #include -//#ifdef PDAL_HAVE_PCL_VISUALIZE -//#include -//#include -//#include -//#include -//#endif - #include #include diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 37b9fdfd0f..b969513ed4 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -139,16 +139,17 @@ if (WITH_NITRO) ENDFOREACH(file) endif (WITH_NITRO) -if (WITH_PCL AND WITH_PCL_TEST) - set(PDAL_PCL_TEST_CPP - filters/PCLBlockFilterTest.cpp - ) - FOREACH(file ${PDAL_PCL_TEST_CPP}) - SET(PDAL_UNITTEST_TEST_SRC "${PDAL_UNITTEST_TEST_SRC};${file}" - CACHE INTERNAL "source files for test") - ENDFOREACH(file) -endif (WITH_PCL AND WITH_PCL_TEST) +# Removed WITH_PCL/WITH_PCL_TEST conditional - StageFactory now tests for PCL +# internally. This will eventually be moved to plugins/pcl/test. +set(PDAL_PCL_TEST_CPP + filters/PCLBlockFilterTest.cpp +) + +FOREACH(file ${PDAL_PCL_TEST_CPP}) + SET(PDAL_UNITTEST_TEST_SRC "${PDAL_UNITTEST_TEST_SRC};${file}" + CACHE INTERNAL "source files for test") +ENDFOREACH(file) if (WITH_HDF5) set(PDAL_ICEBRIDGE_TEST_CPP diff --git a/test/unit/filters/PCLBlockFilterTest.cpp b/test/unit/filters/PCLBlockFilterTest.cpp index 4515c8362e..d1bd3dfc6d 100644 --- a/test/unit/filters/PCLBlockFilterTest.cpp +++ b/test/unit/filters/PCLBlockFilterTest.cpp @@ -45,24 +45,30 @@ BOOST_AUTO_TEST_SUITE(PCLBlockFilterTest) -#ifdef PDAL_HAVE_PCL - using namespace pdal; BOOST_AUTO_TEST_CASE(PCLBlockFilterTest_example_passthrough_xml) { - PipelineManager pipeline; - PipelineReader pipelineReader(pipeline); - pipelineReader.readPipeline(Support::datapath("filters/pcl/passthrough.xml")); + StageFactory f; + StageFactory::FilterCreator* fc = f.getFilterCreator("filters.pclblock"); + if (fc) + { + BOOST_CHECK(fc); + + PipelineManager pipeline; + PipelineReader pipelineReader(pipeline); + pipelineReader.readPipeline(Support::datapath("filters/pcl/passthrough.xml")); - pipeline.execute(); - PointContext ctx = pipeline.context(); + pipeline.execute(); + PointContext ctx = pipeline.context(); - PointBufferSet pbSet = pipeline.buffers(); - BOOST_CHECK_EQUAL(pbSet.size(), 1); - PointBufferPtr buf = *pbSet.begin(); - BOOST_CHECK_EQUAL(buf->size(), 81); + PointBufferSet pbSet = pipeline.buffers(); + BOOST_CHECK_EQUAL(pbSet.size(), 1); + PointBufferPtr buf = *pbSet.begin(); + BOOST_CHECK_EQUAL(buf->size(), 81); + } + BOOST_WARN_MESSAGE(fc, "PCLBlock Filter appears to be missing. Is it installed, with PDAL_DRIVER_PATH set?"); } @@ -93,9 +99,10 @@ static void test_filter(const std::string& jsonFile, StageFactory f; StageFactory::FilterCreator* fc = f.getFilterCreator("filters.pclblock"); - BOOST_CHECK(fc); if (fc) { + BOOST_CHECK(fc); + Stage* pcl_block = fc(); pcl_block->setOptions(filter_options); pcl_block->setInput(&reader); @@ -108,6 +115,7 @@ static void test_filter(const std::string& jsonFile, PointBufferPtr buf = *pbSet.begin(); BOOST_CHECK_EQUAL(buf->size(), expectedPointCount); } + BOOST_WARN_MESSAGE(fc, "PCLBlock Filter appears to be missing. Is it installed, with PDAL_DRIVER_PATH set?"); } @@ -248,6 +256,4 @@ BOOST_AUTO_TEST_CASE(PCLBlockFilterTest_filter_VoxelGrid) test_filter("filters/pcl/filter_VoxelGrid.json", 81); } -#endif // PDAL_HAVE_PCL - BOOST_AUTO_TEST_SUITE_END()