build code model via cmake-file-api #532
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
"Extra Generators", such as
CodeBlocksare deprecated since CMake 3.27 and will be removed in future.Running catkin or colcon with CMake generator
-G "CodeBlocks - Unix Makefiles"will show the error:in the compile log.
The suggested way to build a model of the code is via the
cmake-file-api.colcon-cmakealready makes use of this to get the targets in the workspace. We can reuse the query by parsing the reply.I tried to reuse the "FileApi" classes (
FileApiParser,FileApiReader,FileApiQtcData) from theCMakeProjectManagerinside theCMakeProjectManager::Internalnamespace, but couldn't link them. I guess this is somewhat intended with the internal implementation.In the end, I parsed the json file for the reply manually. It seems to work with a small workspace, but I have the feeling it is a bit slower than the original CodeBlocks file parsing.
This will only be supported for colcon for now. At least on Ubuntu, the only version that still supports ROS 1 officially uses an older CMake version and should not see these warnings.
Fixes #520.