diff --git a/ports/spatial-hash/compatible-vcpkg-cmake.patch b/ports/spatial-hash/compatible-vcpkg-cmake.patch new file mode 100644 index 0000000000..57310fb160 --- /dev/null +++ b/ports/spatial-hash/compatible-vcpkg-cmake.patch @@ -0,0 +1,54 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f21fb2c..31040fa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,13 +5,10 @@ set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + +-add_compile_options(-Wall -Wextra) +- + option(SPATIAL_HASH_BUILD_TESTS "Build tests" ON) + +-find_package(Eigen3 REQUIRED) +-find_package(PkgConfig REQUIRED) +-pkg_check_modules(glog REQUIRED IMPORTED_TARGET libglog) ++find_package(Eigen3 CONFIG REQUIRED) ++find_package(glog CONFIG REQUIRED) + + add_library( + ${PROJECT_NAME} +@@ -24,7 +21,7 @@ target_include_directories( + ${PROJECT_NAME} PUBLIC $ + $ + ) +-target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen PkgConfig::glog) ++target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen glog::glog) + + if(SPATIAL_HASH_BUILD_TESTS) + find_package(GTest REQUIRED) +@@ -42,6 +39,7 @@ add_library( + install(TARGETS ${PROJECT_NAME} EXPORT spatial_hash-targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(EXPORT spatial_hash-targets FILE spatial_hashTargets.cmake NAMESPACE spatial_hash:: +diff --git a/cmake/spatial_hashConfig.cmake.in b/cmake/spatial_hashConfig.cmake.in +index ffb1450..1803838 100644 +--- a/cmake/spatial_hashConfig.cmake.in ++++ b/cmake/spatial_hashConfig.cmake.in +@@ -1,9 +1,8 @@ ++include(CMakeFindDependencyMacro) + get_filename_component(spatial_hash_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +-find_dependency(Eigen3 REQUIRED) +-find_package(PkgConfig REQUIRED) +-pkg_check_modules(glog REQUIRED IMPORTED_TARGET libglog) +- ++find_dependency(Eigen3 CONFIG) ++find_dependency(glog CONFIG) + if(NOT TARGET spatial_hash::spatial_hash) + include("${spatial_hash_CMAKE_DIR}/spatial_hashTargets.cmake") + endif() diff --git a/ports/spatial-hash/portfile.cmake b/ports/spatial-hash/portfile.cmake new file mode 100644 index 0000000000..9aa62b83e2 --- /dev/null +++ b/ports/spatial-hash/portfile.cmake @@ -0,0 +1,28 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO MIT-SPARK/Spatial-Hash + REF bf592f26d84beca96e3ddc295ee1cf5b7341dee5 + SHA512 c6e0c0475f2ca9bd9b21b227874202a12191496a446e44c493d6a181636912a342c56a8742cb5597a164f108bce74ec9534e224db4fa916c76930b232c82895f + PATCHES + compatible-vcpkg-cmake.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DSPATIAL_HASH_BUILD_TESTS=OFF +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup( + PACKAGE_NAME spatial_hash + CONFIG_PATH lib/cmake/spatial_hash +) +vcpkg_copy_pdbs() +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") diff --git a/ports/spatial-hash/vcpkg.json b/ports/spatial-hash/vcpkg.json new file mode 100644 index 0000000000..356d821085 --- /dev/null +++ b/ports/spatial-hash/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "spatial-hash", + "version": "1.0.0", + "description": "A minimal C++ library for spatial data structures based on voxel hashing.", + "homepage": "https://github.com/MIT-SPARK/Spatial-Hash", + "license": "BSD-3-Clause", + "dependencies": [ + "eigen3", + "glog", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 3b519efe64..c7c1a36058 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -8556,6 +8556,10 @@ "baseline": "1.22", "port-version": 4 }, + "spatial-hash": { + "baseline": "1.0.0", + "port-version": 0 + }, "spatialite-tools": { "baseline": "5.1.0-a", "port-version": 0 diff --git a/versions/s-/spatial-hash.json b/versions/s-/spatial-hash.json new file mode 100644 index 0000000000..1ea93db694 --- /dev/null +++ b/versions/s-/spatial-hash.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "74c5903f7439bd4d1b11f52fa77abe8d8eb8defd", + "version": "1.0.0", + "port-version": 0 + } + ] +}