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

New roslint command results in 'Unknown CMake command' #80

Closed
lucasw opened this issue Feb 4, 2021 · 2 comments
Closed

New roslint command results in 'Unknown CMake command' #80

lucasw opened this issue Feb 4, 2021 · 2 comments

Comments

@lucasw
Copy link

lucasw commented Feb 4, 2021

I'm experimenting with a roslint_rust() in https://github.com/lucasw/roslint/blob/roslint_rust/cmake/roslint-extras.cmake.em, and I have that roslint and my_package wanting to use roslint_rust in the same catkin workspace, but trying to use the new roslint results in:

catkin build my_package --no-deps --verbose --catkin-make-args roslint
...
  Unknown CMake command "roslint_rust".

Do I need additional modifications to roslint-extras.cmake.em to expose the new command? Or is there something else that needs to be recompiled to make use of the overlaid custom version of roslint?

Current work-around is to define the roslint_rust function within my_package

function(roslint_rust)
  _roslint_create_targets()
  add_custom_command(TARGET roslint_${PROJECT_NAME} POST_BUILD
                     WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
                     COMMAND ${CATKIN_ENV} cargo clippy -- -D warnings VERBATIM)
endfunction()

roslint_rust()
@mikepurvis
Copy link
Member

You need to tell catkin about your extras:

https://github.com/ros/roslint/blob/master/CMakeLists.txt#L6

@lucasw
Copy link
Author

lucasw commented Feb 4, 2021

Whoops, it turned out I just needed to do a full catkin clean first, I thought I could get away with deleting just build/my_package and devel/.private/my_package.

@lucasw lucasw closed this as completed Feb 4, 2021
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