use globally defined varible for cppcheck include dirs#125
use globally defined varible for cppcheck include dirs#125Karsten1987 merged 2 commits intomasterfrom
Conversation
|
|
||
| # Get include paths for added targets | ||
| set(_all_include_dirs "") | ||
| if(DEFINED AMENT_CMAKE_CPPCHECK_INCLUDE_DIRS) |
There was a problem hiding this comment.
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.
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.
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_DIRSwhich 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