-
Notifications
You must be signed in to change notification settings - Fork 105
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
use globally defined varible for cppcheck include dirs #125
Conversation
@@ -29,6 +29,10 @@ if(_source_files) | |||
|
|||
# Get include paths for added targets | |||
set(_all_include_dirs "") | |||
if(DEFINED AMENT_CMAKE_CPPCHECK_INCLUDE_DIRS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to use lowercase for the AMENT_CMAKE_CPPCHECK
to match the package name and other variables in style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now that I think about, maybe a completely different name could be good. Might be confusing with the default c++ like include dirs.
what about ament_cmake_cppcheck_EXTERNAL_DIRS
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ament_cmake_cppcheck_EXTERNAL_INCLUDE_DIRS
?
ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake
Outdated
Show resolved
Hide resolved
For your example usage of this new API what are you intending to set the variable to? Are these paths actually external? |
yes, they are meant to be external. AFAIK, the cmake logic implemented in this file gets all local/internal include dirs and specifically excludes external ones. @jacobperron is my understanding here correct? |
Correct. The affected package is I expect this issue is likely to affect other packages that similarly try to use the same macros from |
I am not convinced that "external" is a good prefix here. There is no reason that the path needs to be external. It can literally point anywhere - e.g. into the packages build directory. Therefore I would suggest a different prefix, e.g.: |
@Karsten1987 also please use "Signed-Off-By" for your commits to pass the DCO check. |
650de69
to
104cc2c
Compare
changed to |
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
104cc2c
to
05c794c
Compare
updated docblock mentioning how to set the include dirs for cppcheck |
Signed-off-by: Karsten Knese <karsten@openrobotics.org> period
5d6c058
to
7992753
Compare
rebased for DCO compliance. |
introduces a new variable
AMENT_CMAKE_CPPCHECK_INCLUDE_DIRS
which can be set externally to configure cppcheck's include dirs.the new variable can then be used externally in projects as such:
connects to the CI warnings found here: ros2/rosbag2#86