diff --git a/ports/pdal-c/cmake-project-include.cmake b/ports/pdal-c/cmake-project-include.cmake new file mode 100644 index 00000000000000..39f3cca6d23982 --- /dev/null +++ b/ports/pdal-c/cmake-project-include.cmake @@ -0,0 +1,3 @@ +if(WIN32) + add_compile_definitions(NOMINMAX) +endif() diff --git a/ports/pdal-c/fix-docs-version.patch b/ports/pdal-c/fix-docs-version.patch deleted file mode 100644 index d44b50b6141b8b..00000000000000 --- a/ports/pdal-c/fix-docs-version.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1fbc4a4..c8a325a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -23,7 +23,8 @@ set(CMAKE_RELWITHDEBINFO_POSTFIX "" CACHE STRING "CMake RelWithDebInfo suffix") - set(PDALC_ENABLE_CODE_COVERAGE ON CACHE BOOL "Enable code coverage calculation") - set(PDALC_GCC_PARAM_GGC_MIN_HEAPSIZE "131072" CACHE STRING "GCC garbage collection minimum heap size") - --include(ObtainProjectVersion) -+set(${PROJECT_NAME}_VERSION "1.8") -+set(BUILD_ID "vcpkg build") - include_directories("${CMAKE_SOURCE_DIR}/source") - - if(CMAKE_COMPILER_IS_GNUCXX) diff --git a/ports/pdal-c/portfile.cmake b/ports/pdal-c/portfile.cmake index 3e1b8c1a93b405..bb06b4d04cfeca 100644 --- a/ports/pdal-c/portfile.cmake +++ b/ports/pdal-c/portfile.cmake @@ -1,32 +1,28 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO PDAL/CAPI - REF 1.8 - SHA512 6a5f4cb3d36b419f3cd195028c3e6dc17abf3cdb7495aa3df638bc1f842ba98243c73e051e9cfcd3afe22787309cb871374b152ded92e6e06f404cd7b1ae50bf - HEAD_REF master - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/fix-docs-version.patch - ${CMAKE_CURRENT_LIST_DIR}/preserve-install-dir.patch - ${CMAKE_CURRENT_LIST_DIR}/remove-tests.patch + OUT_SOURCE_PATH SOURCE_PATH + REPO PDAL/CAPI + REF v2.1.0 + SHA512 07c671f83af93594d7792d770890205aad1a44803696f9567aa25f69a277fa5c3f4e9f9f5f0210ebd59f5cf75aff1f80ce532bd7bbd536a699724ceb6e3277fd + HEAD_REF master ) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DPDALC_ENABLE_CODE_COVERAGE:BOOL=OFF +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + "-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake" + -DPDALC_ENABLE_CODE_COVERAGE:BOOL=OFF + -DPDALC_ENABLE_DOCS:BOOL=OFF + -DPDALC_ENABLE_TESTS:BOOL=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_Git:BOOL=ON ) -vcpkg_install_cmake() +vcpkg_cmake_install() vcpkg_copy_pdbs() # Remove headers from debug -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") # Install copyright -file(INSTALL ${SOURCE_PATH}/LICENSE.md - DESTINATION ${CURRENT_PACKAGES_DIR}/share/pdal-c - RENAME copyright -) +file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/pdal-c/preserve-install-dir.patch b/ports/pdal-c/preserve-install-dir.patch deleted file mode 100644 index 87377ab2f5500d..00000000000000 --- a/ports/pdal-c/preserve-install-dir.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1fbc4a4..075c86c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -13,8 +13,6 @@ set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) - --# Install to the build directory --set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE STRING "CMake install prefix" FORCE) - - # Use "d" suffix for debug builds - # Do not use a suffix for RelWithDebInfo diff --git a/ports/pdal-c/remove-tests.patch b/ports/pdal-c/remove-tests.patch deleted file mode 100644 index c50914e576e2cd..00000000000000 --- a/ports/pdal-c/remove-tests.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1fbc4a4..e31e552 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -44,7 +44,3 @@ endif() - - add_subdirectory("source/pdal") - add_subdirectory("doc") -- --include(CTest) --add_subdirectory("tests/data") --add_subdirectory("tests/pdal") diff --git a/ports/pdal-c/vcpkg.json b/ports/pdal-c/vcpkg.json index c0629c9909de99..f02d1afdfc5177 100644 --- a/ports/pdal-c/vcpkg.json +++ b/ports/pdal-c/vcpkg.json @@ -1,9 +1,17 @@ { "name": "pdal-c", - "version-string": "1.8", - "port-version": 3, + "version-string": "2.1", "description": "C API for the Point Data Abstraction Library (PDAL)", + "homepage": "https://github.com/PDAL/CAPI#readme", + "supports": "!(windows & staticcrt)", "dependencies": [ - "pdal" + { + "name": "pdal", + "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + } ] } diff --git a/ports/pdal/0001-win32_compiler_options.cmake.patch b/ports/pdal/0001-win32_compiler_options.cmake.patch deleted file mode 100644 index 8486cc1cd97c20..00000000000000 --- a/ports/pdal/0001-win32_compiler_options.cmake.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Nuar a/cmake/win32_compiler_options.cmake b/cmake/win32_compiler_options.cmake ---- a/cmake/win32_compiler_options.cmake 2018-04-06 20:24:17.000000000 +0200 -+++ b/cmake/win32_compiler_options.cmake 2018-04-28 19:40:54.534593200 +0200 -@@ -67,10 +67,6 @@ - endif() - endif() - --set(CMAKE_INCLUDE_PATH "c:/OSGeo4W64/include;$ENV{CMAKE_INCLUDE_PATH}") --set(CMAKE_LIBRARY_PATH "c:/OSGeo4W64/lib;$ENV{CMAKE_LIBRARY_PATH}") --set(CMAKE_PREFIX_PATH "c:/OSGeo4W64/cmake;$ENV{CMAKE_LIBRARY_PATH}") -- - #ABELL (& gadomski) - WHY? - set(PDAL_PLATFORM_WIN32 1) - set(WINSOCK_LIBRARY ws2_32) diff --git a/ports/pdal/0002-no-source-dir-writes.patch b/ports/pdal/0002-no-source-dir-writes.patch index f7ec12f6bfba81..f739cdf7dc794f 100644 --- a/ports/pdal/0002-no-source-dir-writes.patch +++ b/ports/pdal/0002-no-source-dir-writes.patch @@ -19,31 +19,3 @@ index dc146d1..9b82544 100644 ${PDAL_SRC_DIR}/compression/*.cpp) file(GLOB_RECURSE PRIVATE_SRCS ${PDAL_FILTERS_DIR}/private/*.cpp -diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt -index b02aa4a..d60b041 100644 ---- a/apps/CMakeLists.txt -+++ b/apps/CMakeLists.txt -@@ -66,9 +66,9 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pdal.pc - if(UNIX OR APPLE) - # Autoconf compatibility variables to use the same script source. - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pdal-config.in" -- "${CMAKE_CURRENT_SOURCE_DIR}/pdal-config" @ONLY) -+ "${CMAKE_CURRENT_BINARY_DIR}/pdal-config" @ONLY) - -- file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/pdal-config" -+ file(COPY "${CMAKE_CURRENT_BINARY_DIR}/pdal-config" - DESTINATION - "${PDAL_OUTPUT_BIN_DIR}/" - FILE_PERMISSIONS -@@ -85,9 +85,9 @@ if(UNIX OR APPLE) - elseif(WIN32) - # Autoconf compatibility variables to use the same script source. - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pdal-config-bat.in" -- "${CMAKE_CURRENT_SOURCE_DIR}/pdal-config.bat" @ONLY) -+ "${CMAKE_CURRENT_BINARY_DIR}/pdal-config.bat" @ONLY) - -- file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/pdal-config.bat" -+ file(COPY "${CMAKE_CURRENT_BINARY_DIR}/pdal-config.bat" - DESTINATION - "${PDAL_OUTPUT_BIN_DIR}/" - FILE_PERMISSIONS diff --git a/ports/pdal/0003-fix-copy-vendor.patch b/ports/pdal/0003-fix-copy-vendor.patch index 3aad7af320a9e9..092c4651fcf7e6 100644 --- a/ports/pdal/0003-fix-copy-vendor.patch +++ b/ports/pdal/0003-fix-copy-vendor.patch @@ -1,59 +1,20 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 43e446a..c4c7d6f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -339,6 +339,30 @@ install(DIRECTORY ${PDAL_FILTERS_DIR} - install(FILES ${DIMENSION_OUTFILE} ${pdal_features_hpp} - DESTINATION include/pdal - ) -+# Install vendor headers -+install(DIRECTORY ${PDAL_VENDOR_ARBITER_DIR} -+ DESTINATION include/pdal/vendor -+ FILES_MATCHING PATTERN "*.hpp" -+ PATTERN "private" EXCLUDE -+) -+ -+install(DIRECTORY ${PDAL_VENDOR_JSONCPP_DIR} -+ DESTINATION include/pdal/vendor -+ FILES_MATCHING PATTERN "*.h" -+ PATTERN "private" EXCLUDE -+) -+ -+install(DIRECTORY ${PDAL_VENDOR_KAZHDAN_DIR} -+ DESTINATION include/pdal/vendor -+ FILES_MATCHING PATTERN "*.h" -+ PATTERN "private" EXCLUDE -+) -+ -+install(DIRECTORY ${PDAL_VENDOR_NANOFLANN_DIR} -+ DESTINATION include/pdal/vendor -+ FILES_MATCHING PATTERN "*.hpp" -+ PATTERN "private" EXCLUDE -+) - - # - # CPACK -@@ -348,7 +373,7 @@ add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) - - export( - TARGETS -- ${PDAL_BASE_LIB_NAME} ${PDAL_UTIL_LIB_NAME} -+ ${PDAL_BASE_LIB_NAME} ${PDAL_ARBITER_LIB_NAME} ${PDAL_KAZHDAN_LIB_NAME} ${PDAL_UTIL_LIB_NAME} - FILE - "${PDAL_BINARY_DIR}/PDALTargets.cmake") - -diff --git a/cmake/directories.cmake b/cmake/directories.cmake -index f079ec7..8e366e8 100644 ---- a/cmake/directories.cmake -+++ b/cmake/directories.cmake -@@ -11,4 +11,7 @@ set(PDAL_KERNELS_DIR ${ROOT_DIR}/kernels) - set(PDAL_FILTERS_DIR ${ROOT_DIR}/filters) - set(PDAL_IO_DIR ${ROOT_DIR}/io) - set(PDAL_VENDOR_DIR ${ROOT_DIR}/vendor) -- -+set(PDAL_VENDOR_ARBITER_DIR ${PDAL_VENDOR_DIR}/arbiter) -+set(PDAL_VENDOR_JSONCPP_DIR ${PDAL_VENDOR_DIR}/jsoncpp) -+set(PDAL_VENDOR_KAZHDAN_DIR ${PDAL_VENDOR_DIR}/kazhdan) -+set(PDAL_VENDOR_NANOFLANN_DIR ${PDAL_VENDOR_DIR}/nanoflann) - -\ No newline at end of file +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e918a3e..a3f9a03 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -375,6 +375,15 @@ install(DIRECTORY ${PDAL_FILTERS_DIR} + install(FILES ${DIMENSION_OUTFILE} ${pdal_features_hpp} + DESTINATION include/pdal + ) ++# Instaqll vendor headers ++install(DIRECTORY ++ ${PDAL_VENDOR_DIR}/arbiter ++ ${PDAL_VENDOR_DIR}/kazhdan ++ ${PDAL_VENDOR_DIR}/nanoflann ++ DESTINATION include/pdal/vendor ++ FILES_MATCHING PATTERN "*.hpp" PATTERN PATTERN "*.h" ++ PATTERN "private" EXCLUDE ++) + + # + # CPACK diff --git a/ports/pdal/0004-fix-const-overloaded.patch b/ports/pdal/0004-fix-const-overloaded.patch deleted file mode 100644 index 1f820aef340053..00000000000000 --- a/ports/pdal/0004-fix-const-overloaded.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/pdal/PointViewIter.hpp b/pdal/PointViewIter.hpp -index 0c387be..ccb0721 100644 ---- a/pdal/PointViewIter.hpp -+++ b/pdal/PointViewIter.hpp -@@ -139,7 +139,7 @@ public: - - bool operator==(const PointViewIter& i) - { return m_id == i.m_id; } -- bool operator!=(const PointViewIter& i) -+ bool operator!=(const PointViewIter& i) const - { return m_id != i.m_id; } - bool operator<=(const PointViewIter& i) - { return m_id <= i.m_id; } diff --git a/ports/pdal/FindGEOS.cmake b/ports/pdal/FindGEOS.cmake deleted file mode 100644 index 88d17b0733d0d1..00000000000000 --- a/ports/pdal/FindGEOS.cmake +++ /dev/null @@ -1,13 +0,0 @@ -find_path(GEOS_INCLUDE_DIR geos_c.h) - -find_library(GEOS_LIBRARY_DEBUG NAMES geos_cd) -find_library(GEOS_LIBRARY_RELEASE NAMES geos_c) - -include(SelectLibraryConfigurations) -select_library_configurations(GEOS) - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS( - GEOS DEFAULT_MSG - GEOS_LIBRARY GEOS_INCLUDE_DIR -) diff --git a/ports/pdal/fix-CPL_DLL.patch b/ports/pdal/fix-CPL_DLL.patch deleted file mode 100644 index ef7c2647273194..00000000000000 --- a/ports/pdal/fix-CPL_DLL.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/io/GeotiffSupport.cpp b/io/GeotiffSupport.cpp -index 7b75818..909992d 100644 ---- a/io/GeotiffSupport.cpp -+++ b/io/GeotiffSupport.cpp -@@ -43,8 +43,8 @@ PDAL_C_START - - // These functions are available from GDAL, but they - // aren't exported. --char CPL_DLL * GTIFGetOGISDefn(GTIF*, GTIFDefn*); --int CPL_DLL GTIFSetFromOGISDefn(GTIF*, const char*); -+char GTIF_DLL * GTIFGetOGISDefn(GTIF*, GTIFDefn*); -+int GTIF_DLL GTIFSetFromOGISDefn(GTIF*, const char*); - - PDAL_C_END - diff --git a/ports/pdal/fix-dependency.patch b/ports/pdal/fix-dependency.patch index 352eb1d43f1b17..8e794946436c81 100644 --- a/ports/pdal/fix-dependency.patch +++ b/ports/pdal/fix-dependency.patch @@ -1,231 +1,34 @@ -diff --git a/cmake/geos.cmake b/cmake/geos.cmake -index 90b79d9..5942ee5 100644 ---- a/cmake/geos.cmake -+++ b/cmake/geos.cmake -@@ -1,8 +1,5 @@ - # - # GEOS (required) - # --find_package(GEOS QUIET 3.3) --set_package_properties(GEOS PROPERTIES TYPE REQUIRED -- PURPOSE "Provides general purpose geometry support") -- --include_directories("${GEOS_INCLUDE_DIR}") -+find_package(geos CONFIG REQUIRED) -+set(GEOS_LIBRARY GEOS::geos GEOS::geos_c GEOS::geos_cxx_flags) -\ No newline at end of file -diff --git a/cmake/modules/FindPostgreSQL.cmake b/cmake/modules/FindPostgreSQL.cmake -index 8178418..31b54d6 100644 ---- a/cmake/modules/FindPostgreSQL.cmake -+++ b/cmake/modules/FindPostgreSQL.cmake -@@ -80,4 +80,11 @@ find_package_handle_standard_args(PostgreSQL - POSTGRESQL_LIBRARIES - POSTGRESQL_VERSION) - --mark_as_advanced(POSTGRESQL_INCLUDE_DIR POSTGRESQL_LIBRARIES) -+include (CMakeFindDependencyMacro) -+find_package(OpenSSL REQUIRED) -+set(POSTGRESQL_LIBRARIES ${POSTGRESQL_LIBRARIES} OpenSSL::SSL OpenSSL::Crypto) -+if (WIN32) -+ set(POSTGRESQL_LIBRARIES ${POSTGRESQL_LIBRARIES} Secur32) -+endif() -+ -+mark_as_advanced(POSTGRESQL_INCLUDE_DIR POSTGRESQL_LIBRARIES) -\ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 42cca1e..43b0ced 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -174,7 +174,6 @@ if (WITH_TESTS) - add_subdirectory(test) - endif() - add_subdirectory(dimbuilder) --add_subdirectory(vendor/pdalboost) - add_subdirectory(vendor/arbiter) - add_subdirectory(vendor/kazhdan) - if (NOT PDAL_HAVE_JSONCPP) -diff --git a/PDALConfig.cmake.in b/PDALConfig.cmake.in -index a03ef14..9d073e6 100644 ---- a/PDALConfig.cmake.in -+++ b/PDALConfig.cmake.in -@@ -15,6 +15,11 @@ foreach(_dir @PDAL_CONFIG_LIBRARY_DIRS@) - list(APPEND PDAL_LIBRARY_DIRS ${_foo}) - endforeach(_dir) - -+include(CMakeFindDependencyMacro) -+find_dependency(GeoTIFF) -+find_dependency(CURL) -+find_dependency(Boost COMPONENTS system filesystem) -+find_dependency(geos CONFIG) - include("${CMAKE_CURRENT_LIST_DIR}/PDALTargets.cmake") - - if (WIN32) -diff --git a/pdal/util/CMakeLists.txt b/pdal/util/CMakeLists.txt -index 19a2dd1..d498080 100644 ---- a/pdal/util/CMakeLists.txt -+++ b/pdal/util/CMakeLists.txt -@@ -8,6 +8,8 @@ endif() - - include(${PDAL_CMAKE_DIR}/execinfo.cmake) - -+find_package(Boost COMPONENTS system filesystem REQUIRED) -+ - set(PDAL_UTIL_SOURCES - "${PDAL_UTIL_DIR}/Bounds.cpp" - "${PDAL_UTIL_DIR}/Charbuf.cpp" -@@ -16,14 +18,14 @@ set(PDAL_UTIL_SOURCES - "${PDAL_UTIL_DIR}/Utils.cpp" - ) - --PDAL_ADD_FREE_LIBRARY(${PDAL_UTIL_LIB_NAME} SHARED ${PDAL_UTIL_SOURCES}) -+PDAL_ADD_FREE_LIBRARY(${PDAL_UTIL_LIB_NAME} ${PDAL_UTIL_SOURCES}) - target_link_libraries(${PDAL_UTIL_LIB_NAME} +@@ -266,7 +265,7 @@ target_include_directories(${PDAL_BASE_LIB_NAME} + target_link_libraries(${PDAL_BASE_LIB_NAME} PRIVATE - ${EXECINFO_LIBRARY} -- ${PDAL_BOOST_LIB_NAME} -+ PUBLIC -+ Boost::system -+ Boost::filesystem - ) --target_include_directories(${PDAL_UTIL_LIB_NAME} PRIVATE -- ${PDAL_VENDOR_DIR}/pdalboost) - - if (UNIX AND NOT APPLE) - target_link_libraries(${PDAL_UTIL_LIB_NAME} -diff --git a/pdal/util/FileUtils.cpp b/pdal/util/FileUtils.cpp -index 7679f22..b18b674 100644 ---- a/pdal/util/FileUtils.cpp -+++ b/pdal/util/FileUtils.cpp -@@ -124,19 +124,19 @@ std::ostream *createFile(std::string const& name, bool asBinary) - bool directoryExists(const std::string& dirname) - { - //ABELL - Seems we should be calling is_directory -- return pdalboost::filesystem::exists(dirname); -+ return boost::filesystem::exists(dirname); - } - - - bool createDirectory(const std::string& dirname) - { -- return pdalboost::filesystem::create_directory(dirname); -+ return boost::filesystem::create_directory(dirname); - } - - - void deleteDirectory(const std::string& dirname) - { -- pdalboost::filesystem::remove_all(dirname); -+ boost::filesystem::remove_all(dirname); - } - - -@@ -146,15 +146,15 @@ std::vector directoryList(const std::string& dir) - - try - { -- pdalboost::filesystem::directory_iterator it(dir); -- pdalboost::filesystem::directory_iterator end; -+ boost::filesystem::directory_iterator it(dir); -+ boost::filesystem::directory_iterator end; - while (it != end) - { - files.push_back(it->path().string()); - it++; - } - } -- catch (pdalboost::filesystem::filesystem_error) -+ catch (boost::filesystem::filesystem_error) - { - files.clear(); - } -@@ -194,13 +194,13 @@ void closeFile(std::istream* in) - - bool deleteFile(const std::string& file) - { -- return pdalboost::filesystem::remove(file); -+ return boost::filesystem::remove(file); - } - - - void renameFile(const std::string& dest, const std::string& src) - { -- pdalboost::filesystem::rename(src, dest); -+ boost::filesystem::rename(src, dest); - } - - -@@ -211,9 +211,9 @@ bool fileExists(const std::string& name) - - try - { -- return pdalboost::filesystem::exists(name); -+ return boost::filesystem::exists(name); - } -- catch (pdalboost::filesystem::filesystem_error) -+ catch (boost::filesystem::filesystem_error) - { - } - return false; -@@ -222,7 +222,7 @@ bool fileExists(const std::string& name) - - uintmax_t fileSize(const std::string& file) - { -- return pdalboost::filesystem::file_size(file); -+ return boost::filesystem::file_size(file); - } - - -@@ -243,7 +243,7 @@ std::string readFileIntoString(const std::string& filename) - - std::string getcwd() - { -- const pdalboost::filesystem::path p = pdalboost::filesystem::current_path(); -+ const boost::filesystem::path p = boost::filesystem::current_path(); - return addTrailingSlash(p.string()); - } - -@@ -271,7 +271,7 @@ std::string toAbsolutePath(const std::string& filename) - // otherwise, make it absolute (relative to current working dir) and return that - std::string toAbsolutePath(const std::string& filename) - { -- return pdalboost::filesystem::absolute(filename).string(); -+ return boost::filesystem::absolute(filename).string(); - } - - -@@ -283,7 +283,7 @@ std::string toAbsolutePath(const std::string& filename) - std::string toAbsolutePath(const std::string& filename, const std::string base) - { - const std::string newbase = toAbsolutePath(base); -- return pdalboost::filesystem::absolute(filename, newbase).string(); -+ return boost::filesystem::absolute(filename, newbase).string(); - } - - std::string getFilename(const std::string& path) -@@ -304,8 +304,8 @@ std::string getFilename(const std::string& path) - // Get the directory part of a filename. - std::string getDirectory(const std::string& path) - { -- const pdalboost::filesystem::path dir = -- pdalboost::filesystem::path(path).parent_path(); -+ const boost::filesystem::path dir = -+ boost::filesystem::path(path).parent_path(); - return addTrailingSlash(dir.string()); - } - -@@ -326,13 +326,13 @@ std::string stem(const std::string& path) - // Determine if the path represents a directory. - bool isDirectory(const std::string& path) - { -- return pdalboost::filesystem::is_directory(path); -+ return boost::filesystem::is_directory(path); - } - - // Determine if the path is an absolute path - bool isAbsolutePath(const std::string& path) - { -- return pdalboost::filesystem::path(path).is_absolute(); -+ return boost::filesystem::path(path).is_absolute(); - } - - + ${CMAKE_THREAD_LIBS_INIT} +- ${GDAL_LIBRARY} ++ ${GDAL_LIBRARIES} + ${GEOTIFF_LIBRARY} + ${LASZIP_LIBRARY} + ${LIBXML2_LIBRARIES} +diff --git a/cmake/zstd.cmake b/cmake/zstd.cmake +index bfaa5b2..e73ec9e 100644 +--- a/cmake/zstd.cmake ++++ b/cmake/zstd.cmake +@@ -4,7 +4,15 @@ + option(WITH_ZSTD + "Build support for compression/decompression with Zstd." TRUE) + if (WITH_ZSTD) +- find_package(ZSTD QUIET) ++ find_package(zstd CONFIG REQUIRED) ++ set(ZSTD_FOUND TRUE) ++ set(ZSTD_INCLUDE_DIRS "") ++ if(TARGET zstd::libzstd_static) ++ set(ZSTD_LIBRARIES zstd::libzstd_static) ++ set(ZSTD_STATIC_LIB zstd::libzstd_static) ++ else() ++ set(ZSTD_LIBRARIES zstd::libzstd_shared) ++ endif() + set_package_properties(ZSTD PROPERTIES TYPE + PURPOSE "General compression support") + if (ZSTD_FOUND) diff --git a/ports/pdal/fix-find-library-suffix.patch b/ports/pdal/fix-find-library-suffix.patch new file mode 100644 index 00000000000000..53eefb68d12f6e --- /dev/null +++ b/ports/pdal/fix-find-library-suffix.patch @@ -0,0 +1,16 @@ +diff --git a/cmake/libraries.cmake b/cmake/libraries.cmake +index dae98ea..edab055 100644 +--- a/cmake/libraries.cmake ++++ b/cmake/libraries.cmake +@@ -3,11 +3,7 @@ + option(PDAL_BUILD_STATIC "Build PDAL as a static library" OFF) + if (PDAL_BUILD_STATIC) + set(PDAL_LIB_TYPE "STATIC") +- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) + else () + set(PDAL_LIB_TYPE "SHARED") +- if (WIN32) +- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_IMPORT_LIBRARY_SUFFIX}) +- endif() + endif() + mark_as_advanced(PDAL_BUILD_STATIC) diff --git a/ports/pdal/fix-unix-compiler-options.patch b/ports/pdal/fix-unix-compiler-options.patch new file mode 100644 index 00000000000000..79a379cb9cea96 --- /dev/null +++ b/ports/pdal/fix-unix-compiler-options.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 679b4e7..08965d9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -187,7 +187,7 @@ add_subdirectory(apps) + # so that users only need link libpdalcpp. + # + if (APPLE) +- set(PDAL_REEXPORT "-Wl,-reexport_library,$") ++ set(PDAL_REEXPORT "-Wl$-reexport_library$$") + # + # This allows the rpath reference for the reexported library (above) to + # be found. diff --git a/ports/pdal/libpq.patch b/ports/pdal/libpq.patch deleted file mode 100644 index 3aac2188cd0f90..00000000000000 --- a/ports/pdal/libpq.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/cmake/postgres.cmake b/cmake/postgres.cmake -index 0dad71069..32fdae2f8 100644 ---- a/cmake/postgres.cmake -+++ b/cmake/postgres.cmake -@@ -7,3 +7,27 @@ find_package(PostgreSQL REQUIRED) - mark_as_advanced(CLEAR POSTGRESQL_INCLUDE_DIR) - mark_as_advanced(CLEAR POSTGRESQL_LIBRARIES) - include_directories(${POSTGRESQL_INCLUDE_DIR}) -+ -+include(SelectLibraryConfigurations) -+ -+find_library(PostgreSQLCommon_LIBRARY_DEBUG -+NAMES libpgcommond pgcommond pgcommon libpgcommon -+NAMES_PER_DIR -+) -+find_library(PostgreSQLCommon_LIBRARY_RELEASE -+NAMES pgcommon libpgcommon -+NAMES_PER_DIR -+) -+select_library_configurations(PostgreSQLCommon) -+ -+find_library(PostgreSQLPort_LIBRARY_DEBUG -+NAMES pgportd libpgportd pgport libpgport -+NAMES_PER_DIR -+) -+find_library(PostgreSQLPort_LIBRARY_RELEASE -+NAMES pgport libpgport -+NAMES_PER_DIR -+) -+select_library_configurations(PostgreSQLPort) -+ -+list(APPEND POSTGRESQL_LIBRARIES ${PostgreSQLPort_LIBRARIES} ${PostgreSQLCommon_LIBRARIES}) -\ No newline at end of file diff --git a/ports/pdal/no-pkgconfig-requires.patch b/ports/pdal/no-pkgconfig-requires.patch new file mode 100644 index 00000000000000..1f0841e2c73a52 --- /dev/null +++ b/ports/pdal/no-pkgconfig-requires.patch @@ -0,0 +1,12 @@ +diff --git a/apps/pdal.pc.in b/apps/pdal.pc.in +index 6885221..cd2136c 100644 +--- a/apps/pdal.pc.in ++++ b/apps/pdal.pc.in +@@ -5,7 +5,6 @@ includedir=@CMAKE_INSTALL_PREFIX@/include + + Name: PDAL + Description: Point Data Abstraction Library +-Requires: @PKGCONFIG_LIBRARY_DEFINITIONS@ + Version: @PDAL_VERSION@ + Libs: -L${libdir} -l@PDAL_LIB_NAME@ + Cflags: -I${includedir}/pdal @PDAL_CONFIG_DEFINITIONS@ diff --git a/ports/pdal/no-rpath.patch b/ports/pdal/no-rpath.patch new file mode 100644 index 00000000000000..ab2c555c9bf319 --- /dev/null +++ b/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/ports/pdal/portfile.cmake b/ports/pdal/portfile.cmake index 4fbabc1f0f7bae..dda2aead16c1bb 100644 --- a/ports/pdal/portfile.cmake +++ b/ports/pdal/portfile.cmake @@ -1,75 +1,86 @@ -set(PDAL_VERSION_STR "1.7.1") +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) -vcpkg_download_distfile(ARCHIVE - URLS "http://download.osgeo.org/pdal/PDAL-${PDAL_VERSION_STR}-src.tar.gz" - FILENAME "PDAL-${PDAL_VERSION_STR}-src.tar.gz" - SHA512 e3e63bb05930c1a28c4f46c7edfaa8e9ea20484f1888d845b660a29a76f1dd1daea3db30a98607be0c2eeb86930ec8bfd0965d5d7d84b07a4fe4cb4512da9b09 -) - -vcpkg_extract_source_archive_ex( - ARCHIVE ${ARCHIVE} +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH + REPO PDAL/PDAL + REF 2.3.0 + SHA512 898ea54c8c8e0a9bb8aed8d7f542da5a44b02c8656273783366d711b5b3f50b547438aa1cb4d41b490d187dae7bef20fe3b6c64dcb87c06e6f4cb91a8f79ac59 + HEAD_REF master PATCHES - 0001-win32_compiler_options.cmake.patch 0002-no-source-dir-writes.patch 0003-fix-copy-vendor.patch fix-dependency.patch - libpq.patch - fix-CPL_DLL.patch - 0004-fix-const-overloaded.patch + use-vcpkg-boost.patch + fix-unix-compiler-options.patch + fix-find-library-suffix.patch + no-pkgconfig-requires.patch + no-rpath.patch ) file(REMOVE "${SOURCE_PATH}/pdal/gitsha.cpp") +file(REMOVE_RECURSE "${SOURCE_PATH}/vendor/pdalboost/boost" "${SOURCE_PATH}/vendor/pdalboost/libs") -# Deploy custom CMake modules to enforce expected dependencies look-up -foreach(_module IN ITEMS FindGDAL FindGEOS FindGeoTIFF FindCurl) # Outdated; Supplied by CMake - file(REMOVE "${SOURCE_PATH}/cmake/modules/${_module}.cmake") -endforeach() -foreach(_module IN ITEMS FindGEOS) # Overwritten Modules. - file(REMOVE "${SOURCE_PATH}/cmake/modules/${_module}.cmake") - file(COPY ${CMAKE_CURRENT_LIST_DIR}/${_module}.cmake - DESTINATION ${SOURCE_PATH}/cmake/modules/ - ) +# Prefer pristine CMake find modules + wrappers and config files from vcpkg. +foreach(package IN ITEMS Curl GeoTIFF ICONV PostgreSQL ZSTD) + file(REMOVE "${SOURCE_PATH}/cmake/modules/Find${package}.cmake") endforeach() -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" VCPKG_BUILD_STATIC_LIBS) +unset(ENV{OSGEO4W_HOME}) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + draco BUILD_PLUGIN_DRACO + e57 BUILD_PLUGIN_E57 + hdf5 BUILD_PLUGIN_HDF + i3s BUILD_PLUGIN_I3S + laszip WITH_LASZIP + lzma WITH_LZMA + pgpointcloud BUILD_PLUGIN_PGPOINTCLOUD + zstd WITH_ZSTD +) +if(BUILD_PLUGIN_DRACO) + vcpkg_find_acquire_program(PKGCONFIG) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" OPTIONS - -DPDAL_BUILD_STATIC:BOOL=${VCPKG_BUILD_STATIC_LIBS} + -DPDAL_PLUGIN_INSTALL_PATH=. + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" + -DPOSTGRESQL_LIBRARIES=PostgreSQL::PostgreSQL -DWITH_TESTS:BOOL=OFF -DWITH_COMPLETION:BOOL=OFF + -DWITH_LAZPERF:BOOL=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_Libexecinfo:BOOL=ON + -DCMAKE_DISABLE_FIND_PACKAGE_Libunwind:BOOL=ON + ${FEATURE_OPTIONS} + MAYBE_UNUSED_VARIABLES + POSTGRESQL_LIBRARIES ) -vcpkg_install_cmake(ADD_BIN_TO_PATH) -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/pdal/cmake) +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/PDAL) +vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() -# Install PDAL executable -file(GLOB _pdal_apps ${CURRENT_PACKAGES_DIR}/bin/*.exe) -file(COPY ${_pdal_apps} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/pdal) -file(REMOVE ${_pdal_apps}) -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) +# 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}/lib/pdal - ${CURRENT_PACKAGES_DIR}/debug/lib/pdal - ${CURRENT_PACKAGES_DIR}/debug/include - ${CURRENT_PACKAGES_DIR}/debug/share + "${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" ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin) -else() - file(GLOB _pdal_bats ${CURRENT_PACKAGES_DIR}/bin/*.bat) - file(REMOVE ${_pdal_bats}) - file(GLOB _pdal_bats ${CURRENT_PACKAGES_DIR}/debug/bin/*.bat) - file(REMOVE ${_pdal_bats}) - file(GLOB _pdal_apps ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) - file(REMOVE ${_pdal_apps}) -endif() - -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/pdal/usage b/ports/pdal/usage new file mode 100644 index 00000000000000..eaf37886430891 --- /dev/null +++ b/ports/pdal/usage @@ -0,0 +1,9 @@ +The package pdal provides CMake variables: + + find_package(PDAL CONFIG REQUIRED) + target_include_directories(${PDAL_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${PDAL_LIBRARIES}) + +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/ports/pdal/use-vcpkg-boost.patch b/ports/pdal/use-vcpkg-boost.patch new file mode 100644 index 00000000000000..d07bf6eea54ccc --- /dev/null +++ b/ports/pdal/use-vcpkg-boost.patch @@ -0,0 +1,66 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 83a396b..7ebcc3b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -67,7 +67,8 @@ else() + endif() + set(PDAL_LIB_NAME pdalcpp) + set(PDAL_UTIL_LIB_NAME pdal_util) +-set(PDAL_BOOST_LIB_NAME pdal_boost) ++find_package(Boost COMPONENTS filesystem system REQUIRED) ++set(PDAL_BOOST_LIB_NAME Boost::filesystem Boost::system) + set(PDAL_KAZHDAN_LIB_NAME pdal_kazhdan) + set(PDAL_TEST_SUPPORT_OBJS pdal_test_support) + +@@ -179,13 +180,11 @@ endif() + + add_subdirectory(plugins) + +-#include_directories(vendor/pdalboost) + if (WITH_TESTS) + include (${PDAL_CMAKE_DIR}/gtest.cmake) + add_subdirectory(test) + endif() + add_subdirectory(dimbuilder) +-add_subdirectory(vendor/pdalboost) + add_subdirectory(vendor/arbiter) + add_subdirectory(vendor/kazhdan) + add_subdirectory(pdal/util) +@@ -269,7 +268,6 @@ target_include_directories(${PDAL_BASE_LIB_NAME} + ${PROJECT_BINARY_DIR}/include + ${PDAL_VENDOR_DIR} + ${PDAL_VENDOR_DIR}/eigen +- ${PDAL_VENDOR_DIR}/pdalboost + ${LIBXML2_INCLUDE_DIR} + ${ZSTD_INCLUDE_DIRS} + ${NLOHMANN_INCLUDE_DIR} +diff --git a/pdal/util/CMakeLists.txt b/pdal/util/CMakeLists.txt +index 6b3e889..8a42122 100644 +--- a/pdal/util/CMakeLists.txt ++++ b/pdal/util/CMakeLists.txt +@@ -40,8 +40,6 @@ target_link_libraries(${PDAL_UTIL_LIB_NAME} + ${CMAKE_DL_LIBS} + ${CMAKE_THREAD_LIBS_INIT} + ) +-target_include_directories(${PDAL_UTIL_LIB_NAME} PRIVATE +- ${PDAL_VENDOR_DIR}/pdalboost) + + set_target_properties(${PDAL_UTIL_LIB_NAME} PROPERTIES + VERSION "${PDAL_BUILD_VERSION}" +diff --git a/pdal/util/FileUtils.cpp b/pdal/util/FileUtils.cpp +index ee47b55..4a57268 100644 +--- a/pdal/util/FileUtils.cpp ++++ b/pdal/util/FileUtils.cpp +@@ -98,6 +98,12 @@ inline std::string const& toNative(std::string const& in) { return in; } + + } // unnamed namespace + ++namespace pdalboost ++{ ++ namespace filesystem = boost::filesystem; ++ namespace system = boost::system; ++} ++ + namespace FileUtils + { + diff --git a/ports/pdal/vcpkg.json b/ports/pdal/vcpkg.json index 93d9cb70e9aae5..b4f2a01dde978d 100644 --- a/ports/pdal/vcpkg.json +++ b/ports/pdal/vcpkg.json @@ -1,15 +1,109 @@ { "name": "pdal", - "version": "1.7.1", - "port-version": 13, + "version": "2.3.0", "description": "PDAL - Point Data Abstraction Library is a library for manipulating point cloud data.", + "homepage": "https://pdal.io/", + "supports": "!(windows & staticcrt)", "dependencies": [ "boost-filesystem", "boost-system", - "gdal", - "geos", - "jsoncpp", + { + "name": "curl", + "default-features": false + }, + { + "name": "gdal", + "default-features": false + }, + "libgeotiff", + "libxml2", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ "laszip", - "libgeotiff" - ] + "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 + } + ] + }, + "i3s": { + "description": "Build the SLPK/I3S plugins", + "dependencies": [ + "zlib" + ] + }, + "laszip": { + "description": "LASzip support", + "dependencies": [ + "laszip" + ] + }, + "liblzma": { + "description": "Support for compression/decompression with LZMA", + "dependencies": [ + "liblzma" + ] + }, + "pgpointcloud": { + "description": "Build the PgPointCloud plugin", + "dependencies": [ + "libpq" + ] + }, + "supported-plugins": { + "description": "Default set of plugins, dependent on platform", + "dependencies": [ + { + "name": "pdal", + "default-features": false, + "features": [ + "draco", + "e57", + "i3s" + ] + }, + { + "name": "pdal", + "default-features": false, + "features": [ + "hdf", + "pgpointcloud" + ], + "platform": "!uwp" + } + ] + }, + "zstd": { + "description": "Support for ZSTD compression/decompression", + "dependencies": [ + "zstd" + ] + } + } } diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 429ec63d81b448..c9a9938318404c 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1111,10 +1111,6 @@ paho-mqtt:x64-uwp=fail pango:x64-windows-static=fail pango:x64-windows-static-md=fail pangomm:arm64-windows=fail -pdal:x64-linux=fail -pdal:x64-osx=fail -pdal-c:x64-windows-static=fail -pdal-c:x64-windows-static-md=fail pfring:arm64-windows=fail pfring:arm-uwp=fail pfring:x64-uwp=fail diff --git a/versions/baseline.json b/versions/baseline.json index a5fcf88f996554..2fb181985e8e12 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5217,12 +5217,12 @@ "port-version": 2 }, "pdal": { - "baseline": "1.7.1", - "port-version": 13 + "baseline": "2.3.0", + "port-version": 0 }, "pdal-c": { - "baseline": "1.8", - "port-version": 3 + "baseline": "2.1", + "port-version": 0 }, "pdcurses": { "baseline": "3.9", diff --git a/versions/p-/pdal-c.json b/versions/p-/pdal-c.json index b989fb33fdff02..0eb2c8be9f68e4 100644 --- a/versions/p-/pdal-c.json +++ b/versions/p-/pdal-c.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c19bcf077b95f0d81ef14bfdf9774795521d6013", + "version-string": "2.1", + "port-version": 0 + }, { "git-tree": "9319bb871924d143523c4e79ecc45bc9260360b5", "version-string": "1.8", diff --git a/versions/p-/pdal.json b/versions/p-/pdal.json index 65cfa4505309ab..d9f41bdfc13457 100644 --- a/versions/p-/pdal.json +++ b/versions/p-/pdal.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "408d14a540c0a1e217efec2deea453594d9d1bde", + "version": "2.3.0", + "port-version": 0 + }, { "git-tree": "11280c0564220eb3e82eae1c596843daf5b79294", "version": "1.7.1",