aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/spatial-hash
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/spatial-hash
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/spatial-hash')
-rw-r--r--vcpkg/ports/spatial-hash/compatible-vcpkg-cmake.patch54
-rw-r--r--vcpkg/ports/spatial-hash/portfile.cmake28
-rw-r--r--vcpkg/ports/spatial-hash/vcpkg.json19
3 files changed, 101 insertions, 0 deletions
diff --git a/vcpkg/ports/spatial-hash/compatible-vcpkg-cmake.patch b/vcpkg/ports/spatial-hash/compatible-vcpkg-cmake.patch
new file mode 100644
index 0000000..57310fb
--- /dev/null
+++ b/vcpkg/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 $<INSTALL_INTERFACE:include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ )
+-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/vcpkg/ports/spatial-hash/portfile.cmake b/vcpkg/ports/spatial-hash/portfile.cmake
new file mode 100644
index 0000000..9aa62b8
--- /dev/null
+++ b/vcpkg/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/vcpkg/ports/spatial-hash/vcpkg.json b/vcpkg/ports/spatial-hash/vcpkg.json
new file mode 100644
index 0000000..356d821
--- /dev/null
+++ b/vcpkg/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
+ }
+ ]
+}