Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CMake find_package configuration for SEEREP_Core_FB #318

Open
jarkenau opened this issue Jul 27, 2023 · 2 comments
Open

Fix CMake find_package configuration for SEEREP_Core_FB #318

jarkenau opened this issue Jul 27, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jarkenau
Copy link
Member

jarkenau commented Jul 27, 2023

A suitable quote that I found while figuring out (yet) another CMake Error:

CMake is anarchy

The seerep_core_fb package is a pure CMake package, no catkin involved. A ...Config.cmake.in file is used to define its dependencies. This file is passed to CMake to generate the required Config.cmake, which is needed by find_package

The problem is that the cmake.in file has not been updated and still has Protocol Buffer dependencies?!

find_package(Protobuf REQUIRED)
list(APPEND SeerepCoreFb_INCLUDE_DIRS ${Protobuf_INCLUDE_DIR})
list(APPEND SeerepCoreFb_LIBRARIES ${Protobuf_LIBRARY})
find_package(HDF5 REQUIRED)
list(APPEND SeerepCoreFb_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS})
list(APPEND SeerepCoreFb_LIBRARIES ${HDF5_LIBRARIES})
find_package(HighFive REQUIRED)
list(APPEND SeerepCoreFb_INCLUDE_DIRS ${HighFive_INCLUDE_DIRS})
list(APPEND SeerepCoreFb_LIBRARIES ${HighFive_LIBRARIES})
find_package(SeerepMsgs REQUIRED)
list(APPEND SeerepCoreFb_INCLUDE_DIRS ${SeerepMsgs_INCLUDE_DIRS})
list(APPEND SeerepCoreFb_LIBRARIES ${SeerepMsgs_LIBRARIES})
find_package(SeerepHdf5Pb REQUIRED)
list(APPEND SeerepCoreFb_INCLUDE_DIRS ${SeerepHdf5Pb_INCLUDE_DIRS})
list(APPEND SeerepCoreFb_LIBRARIES ${SeerepHdf5Pb_LIBRARIES})

Now if another package want's to use seerep_core_fb and the PB packages have not been build before, an error like this will be thrown

CMake Error at /seerep/devel/lib/cmake/seerepcorefb/SeerepCoreFbConfig.cmake:51 (find_package):
  By not providing "FindSeerepHdf5Pb.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "SeerepHdf5Pb", but CMake did not find one.

  Could not find a package configuration file provided by "SeerepHdf5Pb" with
  any of the following names:

    SeerepHdf5PbConfig.cmake
    seerephdf5pb-config.cmake

Of course, this doesn't happen if you run catkin build to build all packages.

@Mark-Niemeyer
Copy link
Member

Mark-Niemeyer commented Jul 27, 2023

Meta Issue #141

@jarkenau jarkenau changed the title Start to refactor CMake Fix CMake find_package configuration for SEEREP_Core_FB Jul 27, 2023
@jarkenau jarkenau added the bug Something isn't working label Jul 27, 2023
@jarkenau
Copy link
Member Author

This issue probably also applies to other packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants