User forums > Using Code::Blocks

C::B Workspace/project to cmake or premake?

<< < (3/5) > >>

cacb:

--- Quote from: oBFusCATed on December 21, 2020, 01:14:13 pm ---CMake already supports Code::Blocks. With cmake it is the other way round - you write the build system and you get the project files. Generating cmake files from cbp files doesn't make too much sense. Also given the specifics of cmake it might be really hard task to do (cmake has some policies, which a cbp workspace might not follow and then it would be really hard to do the mapping).
--- End quote ---
I know this is the conventional thinking, but I am turning it around anyway. To me, Code::Blocks is the natural development environment during lots of code changing, source files coming and going. For this I am using C::B project files, and I am not willing to give that up and somehow use CMake instead during development.

With released code the situation is different, with stable source files and end user building the software. In that scenario, something like CMake, Premake (or Meson as you mentioned) makes more sense. So to me it does make sense to derive e.g. CMakeLists.txt from Code::Blocks project files. Now, you are probably right to say this is not possible in all cases and I get that. But if I am able to do it for my projects given some rules of how I set up project files, and maybe some user input when generating CMake files I can live with that just fine.


I have almost zero experience with creating CMakeLists.txt, but when I tried yesterday it appeared you have to list all the source files explicitly, so that alone is a motivation for deriving from a Code::blocks project file. Then there are other things you can extract, such as target type, compiler options and dependencies. I will think more about it and experiment.

oBFusCATed:
It seems that you have experience only with going the project way.
You have to gain some native cmake experience before you could make good decisions what is best or usable.

user2024:

--- Quote from: oBFusCATed on November 14, 2020, 12:54:57 pm ---
BTW2: The current integration of cmake is not ideal, it should be the other way round CB should parse cmakefiles and generate the projects somehow. Someday if I get to do the other build system (meson) I'll see if there is a better way. :)

--- End quote ---
Do you mean something like generating a reasonable codeblocks project from this strange cmakelists.txt file? If so, that would be very useful, because I found a lot of projects on the net that use this cmakelists.txt, but converting them into a codeblocks project doesn't work. For this conversion into codeblocks project I use the latest version of cmake, but the program is just rubbish.

sodev:
CMake is the future! Finally the C++ world is getting some sort of standard build system that does not only drive automated builds but can also be used by any IDE. Finally you don't have to maintain multiple build systems to make your CI and users happy.

However, this requires that your favorite IDE does support CMake, which CodeBlocks currently doesn't, and it doesn't look like it will in the near future.

user2024:

--- Quote from: sodev on February 08, 2024, 08:05:00 pm ---However, this requires that your favorite IDE does support CMake,

--- End quote ---
And which IDE does that?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version