fkie/catkin_lint

CMake Subdirectory Handling Broken

Closed this issue · 3 comments

Commit a0dfd73 introduced a change which makes the linter fail because of wrongly concatenated file paths. Specifically the two lines here a0dfd73#diff-6d6ab9f4d4f345d92797be8db11d669fR216.

Consider the minimal project:
catkin_lint_test.zip

When running catkin_lint in the current version inside it, the error

catkin_lint_test: tests/secondLevel/CMakeLists.txt(1): error: add_library() needs missing file 'tests/tests/secondLevel/Test.cpp'
occurs.
The reason is that in the new version info.subdir now contains the path twice.

Reverting these two lines fixes the problem for me but I am not deep enough into the code to propose a complete patch at this point.

I hope we can fix this together :)

You are correct, the line you mention introduced a regression.

Wow, that was fast. Works fine, thanks a lot!

You're welcome! And thank you for reporting the bug!