Skip to content

Link the namespaced octomap::octomap target exported by OctoMap 2.0 - #672

Open
chenrui333 wants to merge 1 commit into
flexible-collision-library:masterfrom
chenrui333:octomap-2-target
Open

chenrui333 wants to merge 1 commit into
flexible-collision-library:masterfrom
chenrui333:octomap-2-target

Conversation

@chenrui333

@chenrui333 chenrui333 commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

OctoMap 2.0.0 modernized its CMake package: it exports the namespaced octomap::octomap target and no longer defines OCTOMAP_INCLUDE_DIRS. FCL's link logic only checks for a bare octomap target or the OCTOMAP_INCLUDE_DIRS/OCTOMAP_LIBRARIES variables, so with OctoMap 2.0 neither branch matches and libfcl is linked without OctoMap:

Undefined symbols for architecture arm64:
  "octomap::OcTree::OcTree(double)", referenced from:
      fcl::OcTree<double>::OcTree(double) in octree.cpp.o

This prefers octomap::octomap when it exists and emits find_dependency(octomap) for it in the exported package config. Older OctoMap versions keep using the existing branches.

Test plan

  • Built FCL 0.7.0 with this change against OctoMap 2.0.0 on macOS arm64 and Linux x86_64 (Homebrew), and ran a program linking libfcl.

This change is Reviewable

OctoMap 2.0 exports the namespaced `octomap::octomap` target and no longer
defines `OCTOMAP_INCLUDE_DIRS`, so neither the `octomap` target branch nor
the variable fallback matches and libfcl is linked without OctoMap:

    Undefined symbols for architecture arm64:
      "octomap::OcTree::OcTree(double)", referenced from:
          fcl::OcTree<double>::OcTree(double) in octree.cpp.o

Prefer `octomap::octomap` when it exists, and emit `find_dependency(octomap)`
for it in the exported package config.

Signed-off-by: Rui Chen <rui@chenrui.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant