diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ab7ea7..2219211 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,12 +161,9 @@ if (WITH_TESTS) endif() add_subdirectory(dimbuilder) add_subdirectory(vendor/arbiter) -add_subdirectory(vendor/schema-validator) add_subdirectory(vendor/kazhdan) add_subdirectory(vendor/lazperf) -add_subdirectory(vendor/utfcpp) add_subdirectory(vendor/lepcc) -add_subdirectory(vendor/h3) add_subdirectory(tools) add_subdirectory(apps) @@ -230,12 +227,13 @@ add_library(PDAL::PDAL ALIAS ${PDAL_LIB_NAME}) +find_package(Eigen3 CONFIG REQUIRED) +target_link_libraries(${PDAL_LIB_NAME} PRIVATE Eigen3::Eigen) target_include_directories(${PDAL_LIB_NAME} SYSTEM BEFORE PRIVATE - ${PDAL_VENDOR_EIGEN_DIR} ${PDAL_VENDOR_DIR}/kazhdan - ${PDAL_VENDOR_DIR}/h3/include ) +target_link_libraries(${PDAL_LIB_NAME} PRIVATE h3::h3) target_include_directories(${PDAL_LIB_NAME} PRIVATE ${ROOT_DIR} @@ -270,6 +268,9 @@ target_link_libraries(${PDAL_LIB_NAME} ${WINSOCK_LIBRARY} ) +find_package(nanoflann CONFIG REQUIRED) +target_link_libraries(${PDAL_LIB_NAME} PRIVATE nanoflann::nanoflann) + if (ZSTD_FOUND) target_link_libraries(${PDAL_LIB_NAME} PRIVATE @@ -304,9 +305,6 @@ target_include_directories(${PDAL_LIB_NAME} INTERFACE $) -target_compile_definitions(${PDAL_LIB_NAME} - PRIVATE - H3_PREFIX=PDALH3) if(WIN32) target_compile_definitions(${PDAL_LIB_NAME} diff --git a/cmake/h3.cmake b/cmake/h3.cmake index 398ad6d..fb3c9ad 100644 --- a/cmake/h3.cmake +++ b/cmake/h3.cmake @@ -2,5 +2,6 @@ # H3 configuration. # -set(PDAL_H3_LIB_NAME pdal_h3) +find_package(h3 CONFIG REQUIRED) +set(PDAL_H3_LIB_NAME h3::h3) diff --git a/cmake/schema-validator.cmake b/cmake/schema-validator.cmake index 1f9f996..aeb598c 100644 --- a/cmake/schema-validator.cmake +++ b/cmake/schema-validator.cmake @@ -1,5 +1,5 @@ # # N Lohmann JSON schema validator handler # -include(${PDAL_CMAKE_DIR}/nlohmann.cmake) -set(JSON_SCHEMA_LIB_NAME pdal_json_schema) +find_package(nlohmann_json_schema_validator CONFIG REQUIRED) +set(JSON_SCHEMA_LIB_NAME nlohmann_json_schema_validator::validator) diff --git a/cmake/utfcpp.cmake b/cmake/utfcpp.cmake index 6543ff6..dc6fac8 100644 --- a/cmake/utfcpp.cmake +++ b/cmake/utfcpp.cmake @@ -1,6 +1,7 @@ # # UTF CPP # -set(UTFCPP_INCLUDE_DIR ${PDAL_VENDOR_DIR}/utfcpp/source) +find_package(utf8cpp CONFIG REQUIRED) +set(UTFCPP_INCLUDE_DIR "") set(UTFCPP_LIB_NAME utf8::cpp) diff --git a/pdal/JsonFwd.hpp b/pdal/JsonFwd.hpp index 507c456..6b502d0 100644 --- a/pdal/JsonFwd.hpp +++ b/pdal/JsonFwd.hpp @@ -1,3 +1,4 @@ +#include #ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ #define INCLUDE_NLOHMANN_JSON_FWD_HPP_ diff --git a/pdal/KDIndex.hpp b/pdal/KDIndex.hpp index 8cfcf50..7c1a7ba 100644 --- a/pdal/KDIndex.hpp +++ b/pdal/KDIndex.hpp @@ -35,6 +35,7 @@ #pragma once #include +#include namespace pdal { @@ -46,7 +47,7 @@ class KDFlexImpl; class PDAL_EXPORT KD2Index { public: - using RadiusResult = std::pair; + using RadiusResult = nanoflann::ResultItem; using RadiusResults = std::vector; KD2Index(const PointView& buf); @@ -79,7 +80,7 @@ private: class PDAL_EXPORT KD3Index { public: - using RadiusResult = std::pair; + using RadiusResult = nanoflann::ResultItem; using RadiusResults = std::vector; KD3Index(const PointView& buf); diff --git a/pdal/private/KDImpl.hpp b/pdal/private/KDImpl.hpp index a328f34..bedb367 100644 --- a/pdal/private/KDImpl.hpp +++ b/pdal/private/KDImpl.hpp @@ -34,7 +34,8 @@ #pragma once -#include +#include +#define SearchParams SearchParameters namespace pdal { @@ -42,7 +43,7 @@ namespace pdal class KD2Impl { public: - using RadiusResults = std::vector>; + using RadiusResults = std::vector>; KD2Impl(const PointView& buf) : m_buf(buf), m_index(2, *this, nanoflann::KDTreeSingleIndexAdaptorParams(100)) @@ -118,7 +119,7 @@ public: PointIdList radius(double x, double y, double r) const { PointIdList output; - std::vector> ret_matches; + std::vector> ret_matches; nanoflann::SearchParams params; params.sorted = true; @@ -157,7 +158,7 @@ private: class KD3Impl { public: - using RadiusResults = std::vector>; + using RadiusResults = std::vector>; KD3Impl(const PointView& buf) : m_buf(buf), m_index(3, *this, nanoflann::KDTreeSingleIndexAdaptorParams(100)) @@ -262,7 +263,7 @@ public: PointIdList radius(double x, double y, double z, double r) const { PointIdList output; - std::vector> ret_matches; + std::vector> ret_matches; nanoflann::SearchParams params; params.sorted = true; @@ -356,7 +357,7 @@ public: PointIdList radius(PointId idx, double r) const { PointIdList output; - std::vector> ret_matches; + std::vector> ret_matches; nanoflann::SearchParams params; params.sorted = true; diff --git a/plugins/e57/CMakeLists.txt b/plugins/e57/CMakeLists.txt index a94ab26..1d15330 100644 --- a/plugins/e57/CMakeLists.txt +++ b/plugins/e57/CMakeLists.txt @@ -7,7 +7,7 @@ if (STANDALONE) endif(STANDALONE) -add_subdirectory(libE57Format) +find_package(e57format CONFIG REQUIRED) PDAL_ADD_PLUGIN(e57plugin_reader reader e57 FILES @@ -21,7 +21,6 @@ PDAL_ADD_PLUGIN(e57plugin_reader reader e57 E57Format ${PDAL_LIBRARIES} INCLUDES - libE57Format/include ) target_compile_definitions(${e57plugin_reader} PRIVATE @@ -38,7 +37,6 @@ PDAL_ADD_PLUGIN(e57plugin_writer writer e57 E57Format ${PDAL_LIBRARIES} INCLUDES - libE57Format/include ) if (WITH_TESTS) diff --git a/tools/lasdump/CMakeLists.txt b/tools/lasdump/CMakeLists.txt index fa842d1..a9f4e7a 100644 --- a/tools/lasdump/CMakeLists.txt +++ b/tools/lasdump/CMakeLists.txt @@ -15,6 +15,7 @@ add_executable(lasdump # Explicitly link and tell CMake to link libstdc++ target_link_libraries(lasdump PRIVATE + ${UTFCPP_LIB_NAME} ${PDAL_LAZPERF_LIB_NAME} GDAL::GDAL "$<$,$,9.0>>:-lstdc++fs>"