Giter VIP home page Giter VIP logo

Comments (4)

wjwwood avatar wjwwood commented on June 27, 2024

Is this a strict requirement that the cmake project name must match the package.xml name?

No, but it is common practice. If you didn't use a package.xml then I think ament would have extracted the project name from CMake automatically.

I'm not sure if there is a way for us to "guess" the right solution file name each time. I guess we could do:

  • extract the project name
    • but you probably can override this setting in CMake (have a different solution file name from the project name)
  • look in the root build folder and assert there is only one .sln file and use that
  • something else?

from ament_tools.

dirk-thomas avatar dirk-thomas commented on June 27, 2024

The package manifest is the only reliable source for the package name in this case. I think it must match the project name used in CMake.

  • Detecting the project name based on the CMakeLists.txt will not work if the argument to project() is not a literal string.
  • Asserting for a single .sln is fragile. Nothing prevent a CMake project to have other projects in the same build space (might not be nice but users usually do anything imaginable).

The question is why should the name in the manifest not match the CMake project name? If I remember correctly we had a similar discussion before on some bitbucket ticket that adding the major version to the project name is a "weird" choice and that you could use the version information to query a specific version of the CMake package rather than appending the major version to the project name.

We also don't plan to support ament_tools in the future. I would suggest you should update the name in the manifest to match the CMake project. Arguably that will affect the packages declaring dependencies on this one (which is why I would suggest a naming scheme without the version number being part of the project name).

from ament_tools.

dirk-thomas avatar dirk-thomas commented on June 27, 2024

I will close this for now since I don't expect that we will support two different names for a package (manifest name being different than e.g. CMake project name). Please feel free to continue commenting here.

from ament_tools.

croesmann avatar croesmann commented on June 27, 2024

Sorry for replying to this old issue. Actually, I ran into a similar problem while trying to release libg2o into ROS2. I am trying to port the Bloom-ReleaseThirdParty workflow to ament. The original 3rd party package uses project(g2o) in the CMakeLists.txt while the ROS package is called libg2o, at least in ROS1. As a consequence, package and library files are installed into install/g2o/ rather than into install/libg2o.
I thought about patching project(g2o) in CMakeLists.txt, however, this requires many changes and potential dependency problems in the whole 3rd party project.

Has anyone already had experience with 3rd party packages, or is there already a best practice?

edit: this in fact concerns ament_cmake instead of ament_tools. I can open a new issue there, but depending on the topic and discussion I placed it here for now...

from ament_tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.