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

CMake unused variable warnings in ROS2 workspace #83

Closed
spiderkeys opened this issue Oct 8, 2019 · 5 comments
Closed

CMake unused variable warnings in ROS2 workspace #83

spiderkeys opened this issue Oct 8, 2019 · 5 comments
Labels
question Further information is requested

Comments

@spiderkeys
Copy link

spiderkeys commented Oct 8, 2019

Referencing some of the behavior described in #16

The behavior of automatically setting the CATKIN_INSTALL_INTO_PREFIX_ROOT variable in a ROS2-only workspace leaves you with a bunch of unused cmake variable warnings:

--- stderr: package_name                                                                                   
CMake Warning:
  Manually-specified variables were not used by the project:

    CATKIN_INSTALL_INTO_PREFIX_ROOT

I silence these in each individual project with:

unset( CATKIN_INSTALL_INTO_PREFIX_ROOT )

but was wondering if there was a way to avoid having to manually specify this in each ROS2 CMakeLists.txt to avoid the additional noise in our build logs? If not, maybe supporting compatibility with catkin_tools in a mixed workspace could be placed behind some flag/option?

@dirk-thomas dirk-thomas added the question Further information is requested label Oct 8, 2019
@dirk-thomas
Copy link
Member

You might want to pass the CMake option --no-warn-unused-cli if you would like to suppress this kind of CMake warning.

@dirk-thomas
Copy link
Member

Assuming my previous comment answered your question I am going to close this ticket for now. Please feel free to continue commenting.

@ckaran
Copy link

ckaran commented Jul 18, 2022

I'm still getting these warnings, but only in some of the projects that I build. Are there any steps I can take to assist in debugging this?

@halejo-as
Copy link

Maybe you are missing the export ament_cmake in your package.xml. That works for me

<export>                               
   <build_type>ament_cmake</build_type> 
</export> 

@ckaran
Copy link

ckaran commented Aug 24, 2022

@halejo-as Thank you for the suggestion, but it appears that isn't the case (at least, from my very fast scripted analysis of the package.xml files)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

4 participants