Handling package-local CMake modules
See original GitHub issueWhen a ROS package uses the “Foo” project with no upstream-provided CMake module, the author may wish to write e.g. cmake/FindFoo.cmake
and then find_package(Foo)
.
However, the “CMake coding standards” document says simply, “Do not set CMAKE_MODULE_PATH
” without suggesting the correct way to do this.
Others who have asked this question haven’t found satisfactory answers, such as this question on ROS Answers (the OP ended up answering his own question by setting CMAKE_MODULE_PATH
, contradictory to coding standards).
Anyway, other experienced ROS developers seem unaware of and violate this standard, such as here. (I understand cmake_modules
makes this an obsolete example, and the line could simply be removed, but…)
The Indigo Migration guide suggests that CMake modules might be contributed to the ROS cmake_modules
package. However, that package’s maintainers wouldn’t be interested in modules for an unpublished package, and .rosinstall
ing a locally-forked version with FindFoo.cmake
is a lot of overhead.
So what is the correct way to find a CMake module that’s local to a package? Is this something missing from catkin, something missing from the docs, or something best accomplished some other way?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Since #951 is merged, I went ahead and submitted PR fkie/catkin_lint#56, reflecting the change in
catkin lint
.Thanks, @dirk-thomas.
Argh, really dumb copy’n’paste error. I’ll fix the original description to
CMAKE_MODULE_PATH
!