Skip to content

Commit

Permalink
scaffold readers.draco and writers.draco
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Nov 9, 2020
1 parent ffed0c4 commit 8c76b82
Show file tree
Hide file tree
Showing 13 changed files with 696 additions and 421 deletions.
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,6 @@ if (NOT PDAL_HAVE_LAZPERF)
${PDAL_SRC_DIR}/compression/LazPerfVlrCompression.cpp)
list(REMOVE_ITEM SRCS ${LAZPERF_SRCS})
endif()
if (NOT PDAL_HAVE_DRACO)
file(GLOB DRACO_SRCS
${PDAL_SRC_DIR}/compression/DracoCompression.cpp)
list(REMOVE_ITEM SRCS ${DRACO_SRCS})
endif()

if (GDAL_VERSION VERSION_LESS 3.0.0)
file(GLOB PROJPIPELINE_FILTER_SRCS
Expand Down Expand Up @@ -293,7 +288,6 @@ target_link_libraries(${PDAL_BASE_LIB_NAME}
${ZLIB_LIBRARIES}
${LIBLZMA_LIBRARIES}
${ZSTD_LIBRARIES}
${DRACO_LIBRARY}
${WINSOCK_LIBRARY}
${PDAL_REEXPORT}
${PDAL_UTIL_LIB_NAME}
Expand Down Expand Up @@ -347,9 +341,6 @@ endif()
if (NOT PDAL_HAVE_LAZPERF)
set(LAZPERF_EXCLUDES PATTERN pdal/compression/LazPerf* EXCLUDE)
endif()
if (NOT PDAL_HAVE_DRACO)
set(DRACO_EXCLUDES PATTERN pdal/compression/Draco* EXCLUDE)
endif()

install(DIRECTORY ${PDAL_INCLUDE_DIR}/pdal
DESTINATION include
Expand Down
1 change: 1 addition & 0 deletions cmake/draco.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if (WITH_DRACO)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
"draco")
set(PDAL_HAVE_DRACO 1)
set(BUILD_PLUGIN_DRACO 1)
set(DRACO_LIBRARY "draco")
else()
set(WITH_DRACO FALSE)
Expand Down
276 changes: 0 additions & 276 deletions pdal/compression/DracoCompression.cpp

This file was deleted.

4 changes: 4 additions & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ if(BUILD_PLUGIN_CPD)
add_subdirectory(cpd)
endif(BUILD_PLUGIN_CPD)

if(BUILD_PLUGIN_DRACO)
add_subdirectory(draco)
endif(BUILD_PLUGIN_DRACO)

if(BUILD_PLUGIN_ICEBRIDGE)
if (NOT PDAL_HAVE_LIBXML2)
message(FATAL_ERROR "Can't build icebridge plugin without libxml2")
Expand Down
71 changes: 71 additions & 0 deletions plugins/draco/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#
# Draco plugin CMake configuration
#
if (NOT Draco_FOUND)
message(FATAL_ERROR "Can't find Draco support required.")
endif()

#
# Draco Reader
#
PDAL_ADD_PLUGIN(reader_libname reader draco
FILES
io/DracoReader.cpp
LINK_WITH
${DRACO_LIBRARY}
INCLUDES
${draco_INCLUDE_DIR}
${NLOHMANN_INCLUDE_DIR}
)

if (WIN32)
target_compile_definitions(${reader_libname} PRIVATE -DNONMINMAX)
endif()

#
# Draco Writer
#

PDAL_ADD_PLUGIN(writer_libname writer draco
FILES
io/DracoWriter.cpp
LINK_WITH
${DRACO_LIBRARY}
INCLUDES
${draco_INCLUDE_DIR}
${NLOHMANN_INCLUDE_DIR}
)

if (WIN32)
target_compile_definitions(${writer_libname} PRIVATE -DNONMINMAX)
endif()

if (WITH_TESTS)

PDAL_ADD_TEST(pdal_io_draco_writer_test
FILES
test/DracoWriterTest.cpp
LINK_WITH
${writer_libname}
${DRACO_LIBRARY}
INCLUDES
${draco_INCLUDE_DIR}
${NLOHMANN_INCLUDE_DIR}
)

PDAL_ADD_TEST(pdal_io_draco_reader_test
FILES
test/DracoReaderTest.cpp
LINK_WITH
${reader_libname}
${writer_libname}
${DRACO_LIBRARY}
)


if (WIN32)
target_compile_definitions(pdal_io_draco_writer_test PRIVATE -DNONMINMAX)
target_compile_definitions(pdal_io_draco_reader_test PRIVATE -DNONMINMAX)
endif()

endif()

0 comments on commit 8c76b82

Please sign in to comment.