Drake¹, a major consumer of LCM, is in the process of transitioning to
Bazel² as its build system. As a consequence, we need Drake to build LCM
via Bazel, but then export LCM so that CMake consumers can find and use it.
I am hoping to teach Bazel to output a CPS³ that will replace⁴
lcmConfig.cmake and associated files. However, one complication is that
CPS *requires* that targets are namespaced. That being said, CMake
already recommends doing this.
I would like to propose renaming the (imported) LCM targets to start
with `lcm::`. (Unfortunately, there does not seem to be any backwards
compatible way to do this.)
Questions:
1. Is this a reasonable/acceptable thing to do?
2. What should the new targets be named?
Right now we have lcm-coretypes, lcm, lcm-static, lcm-gen, lcm-java. I
am wondering, first, if we want to name the imported targets like
lcm::lcm-java or lcm::java (implying that the internal target would also
be renamed, i.e. `make lcm-java` becomes `make java`), and also, should
the main shared library be lcm::lcm, lcm::shared, lcm::lcm-shared, ...?
For now, LCM won't otherwise notice CPS; it's only necessary that the
imported targets from the CMake build (which is not being replaced in
LCM itself) are namespaced so that it is possible to craft a CPS that
will have the same target names.
(¹
http://drake.mit.edu/)
(²
http://bazel.build/)
(³
https://mwoehlke.github.io/cps/)
(⁴ Actually, in the short term - at least until CMake learns to read CPS
directly - we will generate a lcmConfig.cmake from lcm.cps.)
--
Matthew