0

My workspace is a ros2-like workspace in which drake has been wrapped into a CMake package.

drake is pulling in a specific version of the fmt library which I am able to consume it. But the thing is I need to use another version of fmt that I have installed in my system and I would like to know whether there is a way to make that fmt library that drake brings private and not to expose it.

franco.c
  • 3
  • 2

1 Answers1

1

Because Drake uses #include <fmt/format.h> from its public headers, fmt must remain a public (not hidden) dependency of Drake. There is no good way to hide such core dependencies that we use (Eigen, fmt, spdlog).

We try to stay within a few weeks of the most recently tagged fmt release so we hope that works for most users. I suppose you need to use an older revision?

Instead of making fmt hidden, I suggest patching and rebuilding Drake to use your fmt that already exists.

The file that specifies which fmt Drake uses is https://github.com/RobotLocomotion/drake/blob/master/tools/workspace/fmt/repository.bzl. Within the call to the github_archive macro, add one new argument local_repository_override = "/home/username/tmp/install", pointing to a layout that has paths like /home/username/tmp/install/include/fmt/format.h.

If that solves the problem, we can look at exposing a CMake configure option for Drake to find a user-provided fmt and spdlog.

jwnimmer-tri
  • 1,994
  • 2
  • 5
  • 6