diff options
Diffstat (limited to 'vcpkg/ports/pdal')
| -rw-r--r-- | vcpkg/ports/pdal/cmake-project-include.cmake | 8 | ||||
| -rw-r--r-- | vcpkg/ports/pdal/dependencies.diff | 165 | ||||
| -rw-r--r-- | vcpkg/ports/pdal/external-dimbuilder.diff | 11 | ||||
| -rw-r--r-- | vcpkg/ports/pdal/find-library-suffix.diff | 12 | ||||
| -rw-r--r-- | vcpkg/ports/pdal/gdal-3.11.diff | 353 | ||||
| -rw-r--r-- | vcpkg/ports/pdal/h3api.h | 8 | ||||
| -rw-r--r-- | vcpkg/ports/pdal/no-rpath.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/pdal/portfile.cmake | 119 | ||||
| -rw-r--r-- | vcpkg/ports/pdal/rapidxml.diff | 14 | ||||
| -rw-r--r-- | vcpkg/ports/pdal/usage | 8 | ||||
| -rw-r--r-- | vcpkg/ports/pdal/vcpkg.json | 119 |
11 files changed, 829 insertions, 0 deletions
diff --git a/vcpkg/ports/pdal/cmake-project-include.cmake b/vcpkg/ports/pdal/cmake-project-include.cmake new file mode 100644 index 0000000..12f0267 --- /dev/null +++ b/vcpkg/ports/pdal/cmake-project-include.cmake @@ -0,0 +1,8 @@ +include(CheckIncludeFileCXX) + +check_include_file_cxx("filesystem" HAVE_CXX17_FILESYSTEM) +if(NOT HAVE_CXX17_FILESYSTEM) + message(FATAL_ERROR "Unable to find <filesystem> header. PDAL requires full C++17 compiler support.") +endif() + +set_source_files_properties("${PROJECT_SOURCE_DIR}/io/OGRWriter.cpp" PROPERTIES COMPILE_DEFINITIONS NOMINMAX) diff --git a/vcpkg/ports/pdal/dependencies.diff b/vcpkg/ports/pdal/dependencies.diff new file mode 100644 index 0000000..12b9350 --- /dev/null +++ b/vcpkg/ports/pdal/dependencies.diff @@ -0,0 +1,165 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index dc65543..5bccbce 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -158,12 +158,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} +@@ -263,6 +261,8 @@ target_link_libraries(${PDAL_LIB_NAME} + ${PDAL_LIBDIR} + ${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} +@@ -307,9 +307,6 @@ target_include_directories(${PDAL_LIB_NAME} + INTERFACE + $<INSTALL_INTERFACE:include>) + +-target_compile_definitions(${PDAL_LIB_NAME} +- PRIVATE +- H3_PREFIX=PDALH3) + + if(WIN32) + target_compile_definitions(${PDAL_LIB_NAME} +diff --git a/cmake/gdal.cmake b/cmake/gdal.cmake +index 5f68579..a407c60 100644 +--- a/cmake/gdal.cmake ++++ b/cmake/gdal.cmake +@@ -12,7 +12,8 @@ function(gdal_find_version _version) + set(${_version} ${MAJOR}.${MINOR}.${REV} PARENT_SCOPE) + endfunction(gdal_find_version) + +-find_package(GDAL 3.4 REQUIRED) ++find_package(GDAL CONFIG REQUIRED) ++set(GDAL_LIBRARY GDAL::GDAL) + set_package_properties(GDAL PROPERTIES TYPE REQUIRED + PURPOSE "Provides general purpose raster, vector, and reference system support") + if (GDAL_FOUND) +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 f764961..f64dcc6 100644 +--- a/pdal/JsonFwd.hpp ++++ b/pdal/JsonFwd.hpp +@@ -1,3 +1,4 @@ ++#include <nlohmann/json_fwd.hpp> + #ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ + #define INCLUDE_NLOHMANN_JSON_FWD_HPP_ + +diff --git a/pdal/private/KDImpl.hpp b/pdal/private/KDImpl.hpp +index 473ffba..a69431f 100644 +--- a/pdal/private/KDImpl.hpp ++++ b/pdal/private/KDImpl.hpp +@@ -34,7 +34,8 @@ + + #pragma once + +-#include <nanoflann/nanoflann.hpp> ++#include <nanoflann.hpp> ++#define SearchParams SearchParameters + + namespace pdal + { +@@ -116,7 +117,7 @@ public: + PointIdList radius(double const& x, double const& y, double const& r) const + { + PointIdList output; +- std::vector<std::pair<std::size_t, double>> ret_matches; ++ std::vector<nanoflann::ResultItem<std::size_t, double>> ret_matches; + nanoflann::SearchParams params; + params.sorted = true; + +@@ -247,7 +248,7 @@ public: + PointIdList radius(double x, double y, double z, double r) const + { + PointIdList output; +- std::vector<std::pair<std::size_t, double>> ret_matches; ++ std::vector<nanoflann::ResultItem<std::size_t, double>> ret_matches; + nanoflann::SearchParams params; + params.sorted = true; + +@@ -330,7 +331,7 @@ public: + PointIdList radius(PointId idx, double r) const + { + PointIdList output; +- std::vector<std::pair<std::size_t, double>> ret_matches; ++ std::vector<nanoflann::ResultItem<std::size_t, double>> ret_matches; + nanoflann::SearchParams params; + params.sorted = true; + +diff --git a/tools/lasdump/CMakeLists.txt b/tools/lasdump/CMakeLists.txt +index b15d595..a452d14 100644 +--- a/tools/lasdump/CMakeLists.txt ++++ b/tools/lasdump/CMakeLists.txt +@@ -10,6 +10,7 @@ add_executable(lasdump + ) + + target_link_libraries(lasdump PRIVATE ++ ${UTFCPP_LIB_NAME} + ${PDAL_LAZPERF_LIB_NAME} + ${GDAL_LIBRARY} + ) diff --git a/vcpkg/ports/pdal/external-dimbuilder.diff b/vcpkg/ports/pdal/external-dimbuilder.diff new file mode 100644 index 0000000..2aefb28 --- /dev/null +++ b/vcpkg/ports/pdal/external-dimbuilder.diff @@ -0,0 +1,11 @@ +diff --git a/dimbuilder/CMakeLists.txt b/dimbuilder/CMakeLists.txt +index 99109b7..fa2355d 100644 +--- a/dimbuilder/CMakeLists.txt ++++ b/dimbuilder/CMakeLists.txt +@@ -1,3 +1,6 @@ ++add_executable(dimbuilder IMPORTED GLOBAL) ++set_target_properties(dimbuilder PROPERTIES IMPORTED_LOCATION "${DIMBUILDER_EXECUTABLE}") ++return() + # + # The seemingly strange arrangement of this cmake file allows you to build + # this application as a standalone. diff --git a/vcpkg/ports/pdal/find-library-suffix.diff b/vcpkg/ports/pdal/find-library-suffix.diff new file mode 100644 index 0000000..afbefc5 --- /dev/null +++ b/vcpkg/ports/pdal/find-library-suffix.diff @@ -0,0 +1,12 @@ +diff --git a/cmake/libraries.cmake b/cmake/libraries.cmake +index 6847cf6..47e9748 100644 +--- a/cmake/libraries.cmake ++++ b/cmake/libraries.cmake +@@ -2,7 +2,6 @@ + + set(PDAL_LIB_TYPE "SHARED") + if (WIN32) +- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_IMPORT_LIBRARY_SUFFIX}) + endif() + + diff --git a/vcpkg/ports/pdal/gdal-3.11.diff b/vcpkg/ports/pdal/gdal-3.11.diff new file mode 100644 index 0000000..1074629 --- /dev/null +++ b/vcpkg/ports/pdal/gdal-3.11.diff @@ -0,0 +1,353 @@ +diff --git a/filters/OverlayFilter.cpp b/filters/OverlayFilter.cpp +index 5246779..590ddcc 100644 +--- a/filters/OverlayFilter.cpp ++++ b/filters/OverlayFilter.cpp +@@ -93,7 +93,7 @@ void OverlayFilter::prepared(PointTableRef table) + void OverlayFilter::ready(PointTableRef table) + { + m_ds = OGRDSPtr(OGROpen(m_datasource.c_str(), 0, 0), +- [](void *p){ if (p) ::OGR_DS_Destroy(p); }); ++ [](OGRDSPtr::element_type *p){ if (p) ::OGR_DS_Destroy(p); }); + if (!m_ds) + throwError("Unable to open data source '" + m_datasource + "'"); + +@@ -114,7 +114,7 @@ void OverlayFilter::ready(PointTableRef table) + OGR_L_SetSpatialFilter(m_lyr, g.getOGRHandle()); + } + +- auto featureDeleter = [](void *p) ++ auto featureDeleter = [](OGRFeaturePtr::element_type *p) + { + if (p) + ::OGR_F_Destroy(p); +diff --git a/filters/OverlayFilter.hpp b/filters/OverlayFilter.hpp +index c9995d7..141bf51 100644 +--- a/filters/OverlayFilter.hpp ++++ b/filters/OverlayFilter.hpp +@@ -41,6 +41,7 @@ + #include <map> + #include <memory> + #include <string> ++#include <type_traits> + + // Get GDAL's forward decls if available + // otherwise make our own +@@ -58,9 +59,13 @@ namespace gdal + class ErrorHandler; + } + ++#if __has_include(<gdal_fwd.h>) ++typedef std::shared_ptr<std::remove_pointer<OGRDataSourceH>::type> OGRDSPtr; ++typedef std::shared_ptr<std::remove_pointer<OGRFeatureH>::type> OGRFeaturePtr; ++#else + typedef std::shared_ptr<void> OGRDSPtr; + typedef std::shared_ptr<void> OGRFeaturePtr; +-typedef std::shared_ptr<void> OGRGeometryPtr; ++#endif + + class Arg; + +@@ -90,8 +95,6 @@ private: + OverlayFilter& operator=(const OverlayFilter&) = delete; + OverlayFilter(const OverlayFilter&) = delete; + +- typedef std::shared_ptr<void> OGRDSPtr; +- + OGRDSPtr m_ds; + OGRLayerH m_lyr; + std::string m_dimName; +diff --git a/io/TIndexReader.cpp b/io/TIndexReader.cpp +index 0d9c4ca..551b3ea 100644 +--- a/io/TIndexReader.cpp ++++ b/io/TIndexReader.cpp +@@ -89,7 +89,7 @@ TIndexReader::FieldIndexes TIndexReader::getFields() + { + FieldIndexes indexes; + +- void *fDefn = OGR_L_GetLayerDefn(m_layer); ++ OGRFeatureDefnH fDefn = OGR_L_GetLayerDefn(m_layer); + + indexes.m_filename = OGR_FD_GetFieldIndex(fDefn, + m_args->m_tileIndexColumnName.c_str()); +diff --git a/io/TIndexReader.hpp b/io/TIndexReader.hpp +index 1188a1c..ccedfb6 100644 +--- a/io/TIndexReader.hpp ++++ b/io/TIndexReader.hpp +@@ -41,6 +41,15 @@ + + #include <pdal/JsonFwd.hpp> + ++// Get GDAL's forward decls if available ++// otherwise make our own ++#if __has_include(<gdal_fwd.h>) ++#include <gdal_fwd.h> ++#else ++using OGRDataSourceH = void *; ++using OGRLayerH = void *; ++#endif ++ + namespace pdal + { + +@@ -88,8 +97,8 @@ private: + + std::unique_ptr<Args> m_args; + std::unique_ptr<gdal::SpatialRef> m_out_ref; +- void *m_dataset; +- void *m_layer; ++ OGRDataSourceH m_dataset; ++ OGRLayerH m_layer; + + StageFactory m_factory; + MergeFilter m_merge; +diff --git a/kernels/TIndexKernel.cpp b/kernels/TIndexKernel.cpp +index 1f43c75..82d6c81 100644 +--- a/kernels/TIndexKernel.cpp ++++ b/kernels/TIndexKernel.cpp +@@ -723,7 +723,7 @@ TIndexKernel::FieldIndexes TIndexKernel::getFields() + { + FieldIndexes indexes; + +- void *fDefn = OGR_L_GetLayerDefn(m_layer); ++ OGRFeatureDefnH fDefn = OGR_L_GetLayerDefn(m_layer); + + indexes.m_filename = OGR_FD_GetFieldIndex(fDefn, + m_tileIndexColumnName.c_str()); +diff --git a/kernels/TIndexKernel.hpp b/kernels/TIndexKernel.hpp +index a6d8930..72849f7 100644 +--- a/kernels/TIndexKernel.hpp ++++ b/kernels/TIndexKernel.hpp +@@ -40,6 +40,15 @@ + #include <pdal/SubcommandKernel.hpp> + #include <pdal/util/FileUtils.hpp> + ++// Get GDAL's forward decls if available ++// otherwise make our own ++#if __has_include(<gdal_fwd.h>) ++#include <gdal_fwd.h> ++#else ++using OGRDataSourceH = void *; ++using OGRLayerH = void *; ++#endif ++ + namespace pdal + { + class Polygon; +@@ -118,8 +127,8 @@ private: + BOX2D m_bounds; + bool m_absPath; + +- void *m_dataset; +- void *m_layer; ++ OGRDataSourceH m_dataset; ++ OGRLayerH m_layer; + std::string m_tgtSrsString; + std::string m_assignSrsString; + bool m_fastBoundary; +diff --git a/kernels/private/density/OGR.hpp b/kernels/private/density/OGR.hpp +index 243a67a..f61ad4e 100644 +--- a/kernels/private/density/OGR.hpp ++++ b/kernels/private/density/OGR.hpp +@@ -35,6 +35,15 @@ + + #include <string> + ++// Get GDAL's forward decls if available ++// otherwise make our own ++#if __has_include(<gdal_fwd.h>) ++#include <gdal_fwd.h> ++#else ++using OGRDataSourceH = void *; ++using OGRLayerH = void *; ++#endif ++ + namespace hexer + { + class HexGrid; +@@ -45,9 +54,6 @@ namespace pdal + + class OGR + { +- using OGRDataSourceH = void *; +- using OGRLayerH = void *; +- + public: + OGR(std::string const& filename, const std::string& srs, + std::string driver = "ESRI Shapefile", std::string layerName =""); +diff --git a/pdal/Geometry.cpp b/pdal/Geometry.cpp +index c598e66..fec6107 100644 +--- a/pdal/Geometry.cpp ++++ b/pdal/Geometry.cpp +@@ -275,11 +275,11 @@ Geometry Geometry::getRing() const + { + throwNoGeos(); + +- int count = OGR_G_GetGeometryCount(m_geom.get()); ++ int count = OGR_G_GetGeometryCount(gdal::toHandle(m_geom.get())); + if (count) + { + +- OGRGeometryH ring = OGR_G_Clone(OGR_G_GetGeometryRef(m_geom.get(), 0)); ++ OGRGeometryH ring = OGR_G_Clone(OGR_G_GetGeometryRef(gdal::toHandle(m_geom.get()), 0)); + OGRGeometryH linestring = OGR_G_ForceToLineString(ring); + + return Geometry(linestring, getSpatialReference()); +diff --git a/pdal/SpatialReference.cpp b/pdal/SpatialReference.cpp +index cf7abaa..7aec1b6 100644 +--- a/pdal/SpatialReference.cpp ++++ b/pdal/SpatialReference.cpp +@@ -53,22 +53,13 @@ + namespace + { + +-struct OGRDeleter +-{ +- void operator()(OGRSpatialReference* o) +- { +- OSRDestroySpatialReference(o); +- }; +-}; +- + using OGRScopedSpatialReference = +- std::unique_ptr<OGRSpatialReference, OGRDeleter>; ++ std::unique_ptr<OGRSpatialReference>; + + OGRScopedSpatialReference ogrCreateSrs(std::string s = "", double epoch=0.0) + { + OGRScopedSpatialReference r( +- static_cast<OGRSpatialReference*>( +- OSRNewSpatialReference(s.size() ? s.c_str() : nullptr))); ++ new OGRSpatialReference(s.size() ? s.c_str() : nullptr)); + if (!pdal::Utils::compare_approx(epoch, 0.0f, 0.00001f)) + { + #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,4,0) +@@ -129,7 +120,7 @@ bool SpatialReference::valid() const + { + OGRSpatialReference current(m_wkt.data()); + +- return OSRValidate(¤t) == OGRERR_NONE; ++ return current.Validate() == OGRERR_NONE; + } + + +@@ -367,7 +358,7 @@ bool SpatialReference::equals(const SpatialReference& input) const + if (!current || !other) + return false; + +- int output = OSRIsSame(current.get(), other.get()); ++ int output = current.get()->IsSame(other.get()); + + return (output == 1); + } +@@ -398,7 +389,7 @@ bool SpatialReference::isGeographic() const + if (!current) + return false; + +- bool output = OSRIsGeographic(current.get()); ++ bool output = current.get()->IsGeographic(); + return output; + } + +@@ -409,7 +400,7 @@ bool SpatialReference::isGeocentric() const + if (!current) + return false; + +- bool output = OSRIsGeocentric(current.get()); ++ bool output = current.get()->IsGeocentric(); + return output; + } + +@@ -420,7 +411,7 @@ bool SpatialReference::isProjected() const + if (!current) + return false; + +- bool output = OSRIsProjected(current.get()); ++ bool output = current.get()->IsProjected(); + return output; + } + +@@ -573,7 +564,7 @@ int SpatialReference::getUTMZone() const + throw pdal_error("Could not fetch current SRS"); + + int north(0); +- int zone = OSRGetUTMZone(current.get(), &north); ++ int zone = current.get()->GetUTMZone(&north); + return (north ? 1 : -1) * zone; + } + +diff --git a/pdal/private/gdal/GDALUtils.cpp b/pdal/private/gdal/GDALUtils.cpp +index b9d295c..04b7c17 100644 +--- a/pdal/private/gdal/GDALUtils.cpp ++++ b/pdal/private/gdal/GDALUtils.cpp +@@ -357,7 +357,7 @@ std::vector<Polygon> getPolygons(const OGRSpecOptions& ogr) + throw pdal_error("Unable to execute OGR SQL query."); + + SpatialRef sref; +- sref.setFromLayer(poLayer); ++ sref.setFromLayer(reinterpret_cast<OGRLayerH>(poLayer)); + ds->ReleaseResultSet(poLayer); + + poly.update(options.at("geometry").get<std::string>()); +@@ -380,7 +380,7 @@ std::vector<Polygon> getPolygons(const OGRSpecOptions& ogr) + std::vector<Polygon> polys; + while ((poFeature = poLayer->GetNextFeature()) != NULL) + { +- polys.emplace_back(poFeature->GetGeometryRef()); ++ polys.emplace_back(reinterpret_cast<OGRGeometryH>(poFeature->GetGeometryRef())); + OGRFeature::DestroyFeature( poFeature ); + } + +diff --git a/pdal/private/gdal/SpatialRef.cpp b/pdal/private/gdal/SpatialRef.cpp +index 049867e..63bba9e 100644 +--- a/pdal/private/gdal/SpatialRef.cpp ++++ b/pdal/private/gdal/SpatialRef.cpp +@@ -106,9 +106,9 @@ bool SpatialRef::empty() const + return wkt().empty(); + } + +-void SpatialRef::newRef(void *v) ++void SpatialRef::newRef(OGRSpatialReferenceH v) + { +- m_ref = RefPtr(v, [](void* t){ OSRDestroySpatialReference(t); } ); ++ m_ref = RefPtr(v, [](OGRSpatialReferenceH t){ OSRDestroySpatialReference(t); } ); + } + + } // namespace gdal +diff --git a/pdal/private/gdal/SpatialRef.hpp b/pdal/private/gdal/SpatialRef.hpp +index 4d2b34d..80a114c 100644 +--- a/pdal/private/gdal/SpatialRef.hpp ++++ b/pdal/private/gdal/SpatialRef.hpp +@@ -35,6 +35,7 @@ + #pragma once + + #include <memory> ++#include <type_traits> + + // Get GDAL's forward decls if available + // otherwise make our own +@@ -42,6 +43,7 @@ + #include <gdal_fwd.h> + #else + using OGRLayerH = void *; ++ using OGRSpatialReferenceH = void *; + #endif + + +@@ -53,7 +55,7 @@ namespace gdal + + class SpatialRef + { +- typedef std::shared_ptr<void> RefPtr; ++ typedef std::shared_ptr<std::remove_pointer<OGRSpatialReferenceH>::type> RefPtr; + public: + SpatialRef(); + SpatialRef(const std::string& srs); +@@ -65,7 +67,7 @@ public: + bool empty() const; + + private: +- void newRef(void *v); ++ void newRef(OGRSpatialReferenceH v); + + RefPtr m_ref; + }; diff --git a/vcpkg/ports/pdal/h3api.h b/vcpkg/ports/pdal/h3api.h new file mode 100644 index 0000000..41aac33 --- /dev/null +++ b/vcpkg/ports/pdal/h3api.h @@ -0,0 +1,8 @@ +#include <h3/h3api.h> +#define PDALH3degsToRads degsToRads +#define PDALH3radsToDegs radsToDegs +#define PDALH3latLngToCell latLngToCell +#define PDALH3localIjToCell localIjToCell +#define PDALH3cellToLocalIj cellToLocalIj +#define PDALH3cellsToDirectedEdge cellsToDirectedEdge +#define PDALH3directedEdgeToBoundary directedEdgeToBoundary diff --git a/vcpkg/ports/pdal/no-rpath.patch b/vcpkg/ports/pdal/no-rpath.patch new file mode 100644 index 0000000..ab2c555 --- /dev/null +++ b/vcpkg/ports/pdal/no-rpath.patch @@ -0,0 +1,12 @@ +diff --git a/cmake/rpath.cmake b/cmake/rpath.cmake +index ba486b7..4323a77 100644 +--- a/cmake/rpath.cmake ++++ b/cmake/rpath.cmake +@@ -1,6 +1,7 @@ + # + # Set options and variable related to OSX rpath. + # ++return() + + # per http://www.cmake.org/Wiki/CMake_RPATH_handling + SET(CMAKE_SKIP_BUILD_RPATH FALSE) diff --git a/vcpkg/ports/pdal/portfile.cmake b/vcpkg/ports/pdal/portfile.cmake new file mode 100644 index 0000000..9c653ed --- /dev/null +++ b/vcpkg/ports/pdal/portfile.cmake @@ -0,0 +1,119 @@ +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO PDAL/PDAL + REF "${VERSION}" + #[[ + Attention: pdal-dimbuilder must be updated together with pdal + #]] + SHA512 4816c1ef8946937440541b5b8214dd5cbe706ccfbb82e5d67652e983eb6b386a02c1e0ba8ae7e22a0298a65b93953953bc4738d15a33f0f67a39dd6e48dfc076 + HEAD_REF master + PATCHES + dependencies.diff + external-dimbuilder.diff + find-library-suffix.diff + no-rpath.patch + rapidxml.diff +) +file(REMOVE_RECURSE + "${SOURCE_PATH}/cmake/modules/FindCurl.cmake" + "${SOURCE_PATH}/cmake/modules/FindGeoTIFF.cmake" + "${SOURCE_PATH}/cmake/modules/FindICONV.cmake" + "${SOURCE_PATH}/cmake/modules/FindZSTD.cmake" + "${SOURCE_PATH}/vendor/eigen" + "${SOURCE_PATH}/vendor/h3" + "${SOURCE_PATH}/vendor/nanoflann" + "${SOURCE_PATH}/vendor/nlohmann" + "${SOURCE_PATH}/vendor/schema-validator" + "${SOURCE_PATH}/vendor/utfcpp" +) +# PDAL includes "h3api.h", and some calls are decorated with PDALH3 +file(COPY "${CURRENT_PORT_DIR}/h3api.h" DESTINATION "${SOURCE_PATH}") +# PDAL uses namespace 'NL' for nlohmann +file(COPY "${CURRENT_INSTALLED_DIR}/include/nlohmann" DESTINATION "${SOURCE_PATH}/vendor/nlohmann/") +file(APPEND "${SOURCE_PATH}/vendor/nlohmann/nlohmann/json.hpp" "\nnamespace NL = nlohmann;\n") +file(APPEND "${SOURCE_PATH}/vendor/nlohmann/nlohmann/json_fwd.hpp" "\nnamespace NL = nlohmann;\n") +file(WRITE "${SOURCE_PATH}/pdal/JsonFwd.hpp" "/* vcpkg redacted */\n#include <nlohmann/json_fwd.hpp>\nnamespace NL = nlohmann;\n") +file(MAKE_DIRECTORY "${SOURCE_PATH}/vendor/nlohmann/schema-validator") +file(WRITE "${SOURCE_PATH}/vendor/nlohmann/schema-validator/json-schema.hpp" "/* vcpkg redacted */\n#include <nlohmann/json-schema.hpp>\n") +# PDAL vendors arbiter vendors rapidxml +file(COPY "${CURRENT_INSTALLED_DIR}/include/rapidxml/rapidxml.hpp" DESTINATION "${SOURCE_PATH}/vendor/arbiter/") + +unset(ENV{OSGEO4W_HOME}) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + draco BUILD_PLUGIN_DRACO + e57 BUILD_PLUGIN_E57 + hdf5 BUILD_PLUGIN_HDF + lzma WITH_LZMA + pgpointcloud BUILD_PLUGIN_PGPOINTCLOUD + spz BUILD_PLUGIN_SPZ + zstd WITH_ZSTD +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + "-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake" + "-DDIMBUILDER_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/manual-tools/pdal-dimbuilder/dimbuilder${VCPKG_HOST_EXECUTABLE_SUFFIX}" + -DPDAL_PLUGIN_INSTALL_PATH=. + -DWITH_TESTS:BOOL=OFF + -DWITH_COMPLETION:BOOL=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_Libexecinfo:BOOL=ON + -DCMAKE_DISABLE_FIND_PACKAGE_Libunwind:BOOL=ON + ${FEATURE_OPTIONS} +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/PDAL) +vcpkg_fixup_pkgconfig() +vcpkg_copy_pdbs() + +# Install and cleanup executables +file(GLOB pdal_unsupported + "${CURRENT_PACKAGES_DIR}/bin/*.bat" + "${CURRENT_PACKAGES_DIR}/bin/pdal-config" + "${CURRENT_PACKAGES_DIR}/debug/bin/*.bat" + "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe" + "${CURRENT_PACKAGES_DIR}/debug/bin/pdal-config" +) +file(REMOVE ${pdal_unsupported}) +vcpkg_copy_tools(TOOL_NAMES pdal AUTO_CLEAN) + +# Post-install clean-up +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/include/pdal/filters/private/csf" + "${CURRENT_PACKAGES_DIR}/include/pdal/filters/private/miniball" + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" +) + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +set(arbiter_license "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/arbiter LICENSE") +file(COPY_FILE "${SOURCE_PATH}/vendor/arbiter/LICENSE" "${arbiter_license}") + +set(kazhdan_license "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/kazhdan license (PoissonRecon.h)") +file(READ "${SOURCE_PATH}/vendor/kazhdan/PoissonRecon.h" license) +string(REGEX REPLACE "^/\\*\n|\\*/.*\$" "" license "${license}") +file(WRITE "${kazhdan_license}" "${license}") + +set(lazperf_license "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lazperf license (lazperf.hpp)") +file(READ "${SOURCE_PATH}/vendor/lazperf/lazperf.hpp" license) +string(REGEX REPLACE "^/\\*\n|\\*/.*\$" "" license "${license}") +file(WRITE "${lazperf_license}" "${license}") + +set(lepcc_license "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/LEPCC license (LEPCC.h)") +file(READ "${SOURCE_PATH}/vendor/lepcc/src/LEPCC.h" license) +string(REGEX REPLACE "^/\\*\n|\\*/.*\$" "" license "${license}") +file(WRITE "${lepcc_license}" "${license}") + +vcpkg_install_copyright(FILE_LIST + "${SOURCE_PATH}/LICENSE.txt" + "${arbiter_license}" + "${kazhdan_license}" + "${lazperf_license}" + "${lepcc_license}" +) diff --git a/vcpkg/ports/pdal/rapidxml.diff b/vcpkg/ports/pdal/rapidxml.diff new file mode 100644 index 0000000..fb1b17c --- /dev/null +++ b/vcpkg/ports/pdal/rapidxml.diff @@ -0,0 +1,14 @@ +diff --git a/vendor/arbiter/arbiter.hpp b/vendor/arbiter/arbiter.hpp +index 0b4a664..236411b 100644 +--- a/vendor/arbiter/arbiter.hpp ++++ b/vendor/arbiter/arbiter.hpp +@@ -51,7 +51,8 @@ SOFTWARE. + // Beginning of content of file: arbiter/third/xml/rapidxml.hpp + // ////////////////////////////////////////////////////////////////////// + +-#ifndef RAPIDXML_HPP_INCLUDED ++#include "rapidxml.hpp" ++#if 0 + #define RAPIDXML_HPP_INCLUDED + + /* diff --git a/vcpkg/ports/pdal/usage b/vcpkg/ports/pdal/usage new file mode 100644 index 0000000..f0527ad --- /dev/null +++ b/vcpkg/ports/pdal/usage @@ -0,0 +1,8 @@ +pdal provides CMake targets: + + find_package(PDAL CONFIG REQUIRED) + target_link_libraries(main PRIVATE pdalcpp) + +If necessary, override the default plugin search path by setting the +environment variable PDAL_DRIVER_PATH to a list of directories that +PDAL should search for plugins. diff --git a/vcpkg/ports/pdal/vcpkg.json b/vcpkg/ports/pdal/vcpkg.json new file mode 100644 index 0000000..239d7ab --- /dev/null +++ b/vcpkg/ports/pdal/vcpkg.json @@ -0,0 +1,119 @@ +{ + "name": "pdal", + "version": "2.9.2", + "port-version": 1, + "description": "PDAL - Point Data Abstraction Library is a library for manipulating point cloud data.", + "homepage": "https://pdal.io/", + "license": null, + "supports": "!(static & staticcrt)", + "dependencies": [ + { + "name": "curl", + "default-features": false + }, + "eigen3", + { + "name": "gdal", + "default-features": false + }, + "h3", + "json-schema-validator", + "libgeotiff", + { + "name": "libxml2", + "default-features": false + }, + "nanoflann", + "nlohmann-json", + { + "name": "pdal-dimbuilder", + "host": true + }, + "rapidxml", + "utfcpp", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ], + "default-features": [ + "supported-plugins" + ], + "features": { + "draco": { + "description": "Build the Draco plugin", + "dependencies": [ + "draco" + ] + }, + "e57": { + "description": "Build the E57 plugin", + "dependencies": [ + "xerces-c" + ] + }, + "hdf": { + "description": "Build the HDF plugin", + "dependencies": [ + { + "name": "hdf5", + "default-features": false + } + ] + }, + "liblzma": { + "description": "Support for compression/decompression with LZMA", + "dependencies": [ + "liblzma" + ] + }, + "pgpointcloud": { + "description": "Build the PgPointCloud plugin", + "dependencies": [ + { + "name": "libpq", + "default-features": false + } + ] + }, + "spz": { + "description": "Build the SPZ plugin", + "dependencies": [ + "spz" + ] + }, + "supported-plugins": { + "description": "Default set of plugins, dependent on platform", + "dependencies": [ + { + "name": "pdal", + "default-features": false, + "features": [ + "draco", + "e57" + ] + }, + { + "name": "pdal", + "default-features": false, + "features": [ + "hdf", + "pgpointcloud" + ], + "platform": "!uwp" + } + ] + }, + "zstd": { + "description": "Support for ZSTD compression/decompression", + "dependencies": [ + "zstd" + ] + } + } +} |