Skip to content

Conversation

@christian-rauch
Copy link
Member

@christian-rauch christian-rauch commented Mar 31, 2025

"Extra Generators", such as CodeBlocks are 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:

CMake Deprecation Warning:
  Support for "Extra Generators" like

    CodeBlocks

  is deprecated and will be removed from a future version of CMake.  IDEs may
  use the cmake-file-api(7) to view CMake-generated project build trees.

in the compile log.

The suggested way to build a model of the code is via the cmake-file-api. colcon-cmake already 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 the CMakeProjectManager inside the CMakeProjectManager::Internal namespace, 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.

@christian-rauch christian-rauch marked this pull request as ready for review March 31, 2025 21:33
@christian-rauch
Copy link
Member Author

@Levi-Armstrong Could you test this to see if it behaves as expected? You can use the build artifacts to install this on Qt Creator 16. The cmake-file-api parser takes precedence over the CodeBlocks parser now. So this should work as soon as you update the plugin. But you may run this anyway on a clean workspace without the build and install folder, or at least remove all the *.cbp files from the build folder, in order to remove all traces of CodeBlocks.

@christian-rauch christian-rauch merged commit 7aeb745 into ros-industrial:devel Apr 2, 2025
6 checks passed
@christian-rauch christian-rauch deleted the cmake_file_api branch April 2, 2025 16:28
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

Successfully merging this pull request may close these issues.

CodeBlocks generator is deprecated

3 participants