User forums > Using Code::Blocks

Export to CMake

(1/3) > >>

seasoned_geek:
All,

Since the CMake created Code::Blocks project doesn't allow for debugging I thought I would ask.

Does Code::Blocks provide a feature/plug-in that will correctly export a Code::Blocks project to a CMakeLists.txt file? This would neatly solve the problem.

Thanks,

sodev:
To achieve what? Generate a CodeBlocks project from CMake to "export" that generated project to CMake again to do what? Generate something else from that generated CMake "project"? Your source is already CMake, use that one directly instead?

seasoned_geek:

--- Quote from: sodev on November 22, 2021, 02:39:56 pm ---To achieve what? Generate a CodeBlocks project from CMake to "export" that generated project to CMake again to do what? Generate something else from that generated CMake "project"? Your source is already CMake, use that one directly instead?

--- End quote ---

It's a two stage process.

The bulk of the system can be developed in a Ubuntu VM. You could compile and debug over 90% there.

The target device build process must use cmake inside of a container. This is the build process. For development we can include a GDB server so one can perform remote debugging.

The younger team members don't know how to use Emacs. Code::Blocks would be good for them but we must be able to utilize CMake, not try to figure out the CMakeLists.txt file __after__ they've "made it work" in the IDE.

The problem with the cmake generation of a Code::Blocks project file is that it is treated as "foreign" by Code::Blocks. You cannot debug.

It appears most IDEs have rather abysmal CMake support. CodeLite most definitely failed despite all of its claims.

I hope this clarifies the situation.

Thank you for your time.


sodev:
I am not familiar with the CMake generator for CodeBlocks nor the limitations of CodeBlocks when using external Makefiles, maybe the generator is flawed or CodeBlocks just can't debug when using external Makefiles. However, i'm quite confident such CodeBlocks -> CMake export will never exist, this is just not how CMake works.

It's quite sad, but CodeBlocks didn't age well. Since you are using CMake, you have basically two options: Use an IDE that CMake can generate project files for or use an IDE that can use CMake directly. Regarding your specific requirements i can highly suggest to take a look at VSCode. Not only does it have native CMake support that allows to build and debug out-of-the-box with zero configuration (depending on how well your CMake files are crafted and what is required to run the configuration step), it also has this neat Remote Development feature. This allows VSCode, while running on a host system, to connect to a container (or anything else that has ssh) and run the build inside there.

seasoned_geek:

--- Quote from: sodev on November 22, 2021, 08:47:49 pm ---I am not familiar with the CMake generator for CodeBlocks nor the limitations of CodeBlocks when using external Makefiles, maybe the generator is flawed or CodeBlocks just can't debug when using external Makefiles. However, i'm quite confident such CodeBlocks -> CMake export will never exist, this is just not how CMake works.

It's quite sad, but CodeBlocks didn't age well. Since you are using CMake, you have basically two options: Use an IDE that CMake can generate project files for or use an IDE that can use CMake directly. Regarding your specific requirements i can highly suggest to take a look at VSCode. Not only does it have native CMake support that allows to build and debug out-of-the-box with zero configuration (depending on how well your CMake files are crafted and what is required to run the configuration step), it also has this neat Remote Development feature. This allows VSCode, while running on a host system, to connect to a container (or anything else that has ssh) and run the build inside there.

--- End quote ---

VSCode not really an option as there are security issues.

CMake generates Code::Blocks project files. It's just that Code::Blocks isn't polite about using them.

So far every IDE that has made the claim of CMake support has failed, at least every one I've looked at.

Emacs appears to be state of the art. It doesn't try to pull down new software or updates while you are building (major security flaw with VSCode) and it doesn't care who generated the Makefile. It appears to debug anything.

Really wanted Code::Blocks to work.

Navigation

[0] Message Index

[#] Next page

Go to full version