aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/octomap
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/octomap
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/octomap')
-rw-r--r--vcpkg/ports/octomap/001-fix-exported-targets.patch78
-rw-r--r--vcpkg/ports/octomap/fix-isnan.patch25
-rw-r--r--vcpkg/ports/octomap/portfile.cmake46
-rw-r--r--vcpkg/ports/octomap/vcpkg-cmake-wrapper.cmake15
-rw-r--r--vcpkg/ports/octomap/vcpkg.json18
5 files changed, 182 insertions, 0 deletions
diff --git a/vcpkg/ports/octomap/001-fix-exported-targets.patch b/vcpkg/ports/octomap/001-fix-exported-targets.patch
new file mode 100644
index 0000000..c2b8e04
--- /dev/null
+++ b/vcpkg/ports/octomap/001-fix-exported-targets.patch
@@ -0,0 +1,78 @@
+diff --git a/octomap/src/CMakeLists.txt b/octomap/src/CMakeLists.txt
+index 45b384f..ab1b6b1 100644
+--- a/octomap/src/CMakeLists.txt
++++ b/octomap/src/CMakeLists.txt
+@@ -8,17 +8,16 @@ SET (octomap_SRCS
+ OcTreeNode.cpp
+ OcTreeStamped.cpp
+ ColorOcTree.cpp
+- )
++)
++
+
+-# dynamic and static libs, see CMake FAQ:
+-ADD_LIBRARY( octomap SHARED ${octomap_SRCS})
+-set_target_properties( octomap PROPERTIES
++ADD_LIBRARY(octomap ${octomap_SRCS})
++set_target_properties(octomap PROPERTIES
+ VERSION ${OCTOMAP_VERSION}
+ SOVERSION ${OCTOMAP_SOVERSION}
++ OUTPUT_NAME "octomap"
+ )
+-ADD_LIBRARY( octomap-static STATIC ${octomap_SRCS})
+-SET_TARGET_PROPERTIES(octomap-static PROPERTIES OUTPUT_NAME "octomap")
+-add_dependencies(octomap-static octomath-static)
++
+
+ TARGET_LINK_LIBRARIES(octomap octomath)
+
+@@ -26,7 +25,7 @@ if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
+ file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
+ endif()
+
+-export(TARGETS octomap octomap-static
++export(TARGETS octomap
+ APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake")
+
+ ADD_SUBDIRECTORY( testing )
+@@ -67,7 +66,7 @@ TARGET_LINK_LIBRARIES(intersection_example octomap)
+ ADD_EXECUTABLE(octree2pointcloud octree2pointcloud.cpp)
+ TARGET_LINK_LIBRARIES(octree2pointcloud octomap)
+
+-install(TARGETS octomap octomap-static
++install(TARGETS octomap
+ EXPORT octomap-targets
+ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+ ${INSTALL_TARGETS_DEFAULT_ARGS}
+diff --git a/octomap/src/math/CMakeLists.txt b/octomap/src/math/CMakeLists.txt
+index 3b47ec4..6a75170 100644
+--- a/octomap/src/math/CMakeLists.txt
++++ b/octomap/src/math/CMakeLists.txt
+@@ -5,24 +5,22 @@ SET (octomath_SRCS
+ )
+
+
+-ADD_LIBRARY( octomath SHARED ${octomath_SRCS})
++ADD_LIBRARY(octomath ${octomath_SRCS})
+
+ SET_TARGET_PROPERTIES( octomath PROPERTIES
+ VERSION ${OCTOMAP_VERSION}
+ SOVERSION ${OCTOMAP_SOVERSION}
+ )
+
+-ADD_LIBRARY( octomath-static STATIC ${octomath_SRCS})
+-SET_TARGET_PROPERTIES(octomath-static PROPERTIES OUTPUT_NAME "octomath")
+
+ if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
+ file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap")
+ endif()
+
+-export(TARGETS octomath octomath-static
++export(TARGETS octomath
+ APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake")
+
+-install(TARGETS octomath octomath-static
++install(TARGETS octomath
+ EXPORT octomap-targets
+ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+ ${INSTALL_TARGETS_DEFAULT_ARGS}
diff --git a/vcpkg/ports/octomap/fix-isnan.patch b/vcpkg/ports/octomap/fix-isnan.patch
new file mode 100644
index 0000000..5da9a20
--- /dev/null
+++ b/vcpkg/ports/octomap/fix-isnan.patch
@@ -0,0 +1,25 @@
+diff --git a/octomap/src/compare_octrees.cpp b/octomap/src/compare_octrees.cpp
+index c02ceea8..e6890f59 100644
+--- a/octomap/src/compare_octrees.cpp
++++ b/octomap/src/compare_octrees.cpp
+@@ -39,7 +39,7 @@
+ #include <list>
+ #include <cmath>
+
+-#ifdef _MSC_VER // fix missing isnan for VC++
++#if defined(_MSC_VER) && !((defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) || __cplusplus >= 201103L)
+ #define isnan(x) _isnan(x)
+ #endif
+
+@@ -132,11 +132,7 @@ int main(int argc, char** argv) {
+ else
+ kld +=log(p1/p2)*p1 + log((1-p1)/(1-p2))*(1-p1);
+
+-#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) || __cplusplus >= 201103L)
+- if (std::isnan(kld)){
+-#else
+ if (isnan(kld)){
+-#endif
+ OCTOMAP_ERROR("KLD is nan! KLD(%f,%f)=%f; sum = %f", p1, p2, kld, kld_sum);
+ exit(-1);
+ }
diff --git a/vcpkg/ports/octomap/portfile.cmake b/vcpkg/ports/octomap/portfile.cmake
new file mode 100644
index 0000000..c3405ac
--- /dev/null
+++ b/vcpkg/ports/octomap/portfile.cmake
@@ -0,0 +1,46 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO OctoMap/octomap
+ REF "v${VERSION}"
+ SHA512 1cbee4f6b3569587986774447ad9ec4190f597310c4d6865ffa7cd8865ece2492e4a42fa369b633d9d7a9da782560d49deaa62a18601ea4f56396bdf1a6a5f52
+ HEAD_REF devel
+ PATCHES
+ 001-fix-exported-targets.patch
+ fix-isnan.patch # Remove this patch in the next update
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ DISABLE_PARALLEL_CONFIGURE
+ OPTIONS
+ -DBUILD_TESTING=OFF
+ -DBUILD_OCTOVIS_SUBPROJECT=OFF
+ -DBUILD_DYNAMICETD3D_SUBPROJECT=OFF
+)
+
+vcpkg_cmake_install()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_copy_tools(
+ TOOL_NAMES binvox2bt bt2vrml compare_octrees convert_octree edit_octree eval_octree_accuracy graph2tree log2graph
+ AUTO_CLEAN)
+
+vcpkg_cmake_config_fixup()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/octomap")
+
+# Handle copyright
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/octomap/LICENSE.txt")
+
+vcpkg_copy_pdbs()
+
+vcpkg_fixup_pkgconfig()
diff --git a/vcpkg/ports/octomap/vcpkg-cmake-wrapper.cmake b/vcpkg/ports/octomap/vcpkg-cmake-wrapper.cmake
new file mode 100644
index 0000000..2dd237e
--- /dev/null
+++ b/vcpkg/ports/octomap/vcpkg-cmake-wrapper.cmake
@@ -0,0 +1,15 @@
+_find_package(${ARGS})
+
+if(TARGET octomap AND NOT TARGET octomap-static)
+ add_library(octomap-static INTERFACE IMPORTED)
+ set_target_properties(octomap-static PROPERTIES INTERFACE_LINK_LIBRARIES "octomap")
+
+ add_library(octomath-static INTERFACE IMPORTED)
+ set_target_properties(octomath-static PROPERTIES INTERFACE_LINK_LIBRARIES "octomath")
+elseif(TARGET octomap-static AND NOT TARGET octomap)
+ add_library(octomap INTERFACE IMPORTED)
+ set_target_properties(octomap PROPERTIES INTERFACE_LINK_LIBRARIES "octomap-static")
+
+ add_library(octomath INTERFACE IMPORTED)
+ set_target_properties(octomath PROPERTIES INTERFACE_LINK_LIBRARIES "octomath-static")
+endif()
diff --git a/vcpkg/ports/octomap/vcpkg.json b/vcpkg/ports/octomap/vcpkg.json
new file mode 100644
index 0000000..53a6dad
--- /dev/null
+++ b/vcpkg/ports/octomap/vcpkg.json
@@ -0,0 +1,18 @@
+{
+ "name": "octomap",
+ "version": "1.10.0",
+ "description": "An Efficient Probabilistic 3D Mapping Framework Based on Octrees",
+ "homepage": "https://octomap.github.io/",
+ "license": "BSD-3-Clause",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}