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
.