User forums > Using Code::Blocks

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

(1/5) > >>

cacb:
Hi, this may be a naive question, but anyway....

I have lots of Code::Blocks workspaces with several projects dependent on each other. I find this way of working quite excellent so that is fine and I want to keep it that way. My projects use C::B global variables a lot.

Now someone approached me and said they want to build my stuff using CMake . But I don't find it tempting to use CMake as a build system during development (even within C::B), but I can see it would be nice to offer as a "deployment build system". 

Therefore: Have anyone considered automatic generation of CMake files (CMakeLists.txt) or similar for premake from Code::Blocks workspace and project files? I know cbp2make exists for plain make files, so what I am asking for would be kind of similar, but targeting CMake /Premake.

A C::B plugin that allowed export of a C::B workspace to CMake or Premake would bee nice...

Thoughts?

oBFusCATed:
I doubt it would be possible or it would work well.
Fitting the C::B model of projects to CMakes might not match 1:1 and then there would be problems.
Also CMake requires the build system to be out-of-tree and most CB projects are in-tree.

CMake is meant to be used the other way - you write the cmake files by hand and it generates the ide projects/build system.

cacb:

--- Quote from: oBFusCATed on November 14, 2020, 12:12:04 pm ---I doubt it would be possible or it would work well.
--- End quote ---
I guess that is a "no" to my question if anyone have given it a thought for C::B, but I have seen discussions elsewhere of the same idea. But of course, the fact that I have not found such a tool could mean you are right. But I am not convinced.


--- Quote from: oBFusCATed on November 14, 2020, 12:12:04 pm ---CMake is meant to be used the other way - you write the cmake files by hand and it generates the ide projects/build system.
--- End quote ---
Of course I know that, but I disagree with this way of thinking, as maintaining the CMakeLists.txt (or premake equivalent) file would be a nightmare + several other arguments that I will not go into here. C::B projects are well defined in .cbp files, so I can't see why they can not be transformed into CMake or Premake input. If there is an argument about "out-of-tree", well then put the generated CMakeLists.txt (or premake equivalent)  file elsewhere.

In any case, it looks like my main question is answered: No such plugin or external tool exists. So if it becomes a real need, I probably have to create it myself.

oBFusCATed:
If you cannot find it with a simple search in your favourite search engine or github, then probably it doesn't exists.

BTW: CMake is a lot more powerful than our own build system would ever be and it is slow and stupid, but that is how life work not-perfect solutions win at the end.
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. :)

alexchen:
How about generating just simple Make files from CB?  This is our challenge:  we need to build the same source on multiple platforms, Windows, macOS and Linux. Both Windows and macOS's IDE, VS/Xcdoe, can launch the build with command line interface.  CB also has the capability to build from command line but it still needs to pop up a GUI window. If fails with requirement of GTK if I try to launch the command line build from a TTY console.  And we also encounter occasional CB crash in wxGTK library.  We would like to use CB for development build and be able to run Makefile in production builds. 
I remember seeing older version of CB that offers an option to export the project to Makefile.  Do I remember it wrong?

Navigation

[0] Message Index

[#] Next page

Go to full version