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

ament_package() should set reasonable defaults on CPACK_* variables #567

Open
stewpend0us opened this issue Dec 16, 2024 · 2 comments
Open

Comments

@stewpend0us
Copy link

I can't think of a good reason not to set some reasonable defaults on CPACK_* variables from within ament_package().

  • Best case users can just call include(CPack) and now they can produce "packages" (installers)
  • Worst case they and over-write and/or fill out the rest of their CPACK_* variables before calling include(CPack)
  • I'm guessing this would have no effect on the majority of users but may encourage people to move toward using CPack (which is a fantastic tool!)
@traversaro
Copy link
Contributor

traversaro commented Dec 16, 2024

Which reasonable defaults you have in mind? As CPACK_* variables already have a bunch of reasonable defaults (see https://cmake.org/cmake/help/latest/module/CPack.html), if any was missing perhaps it could make more sense to add these defaults upstream in CMake/CPack, or there is some information that ament_package has that is not available in a regular non-ament CMake package?

@stewpend0us
Copy link
Author

I guess the lowest hanging fruit would be the variables taken from package.xml. (I assume) ament parses the package.xml and puts the results in ament_cmake_core/package.cmake at a minimum the Version and Maintainer should be set to the CPACK versions I would think?

The bigger one though is the dependencies. For my own purposes I use the EXEC_DEPENDS out of package.cmake, pass those through rosdep resolve, and put the results (importantly including the errors) as the CPACK*_PACKAGE_DEPENDS. I include the errors because (in my case) the errors are simply my own packages that I depend on. They're not known by rosdep but that doesn't matter. When I do this for all of my packages apt will take care of the rest.

If these things were all done by ament then creating a package for most of my stuff would be as easy as adding an include(CPack) to the bottom of my CMakeLists.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants