Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: 72deluxe on March 23, 2010, 03:39:10 pm

Title: Codeblocks build system and RPM
Post by: 72deluxe on March 23, 2010, 03:39:10 pm
Hello all

I was just wondering with regard to Code::Blocks make system. It seems to work excellently within the program, but I was wondering how to make use of Code::Blocks build system when it comes to building an executable for an RPM. There doesn't seem to be any command line parameters that can be passed to Code::Blocks to do a build WITHOUT opening the main batch build log window. Have I not looked hard enough?
Ideally, it would be good for Code::Blocks to run without a GUI being created.

This doesn't seem to be an issue for building Windows setup programs (just dump everything that has been built into a ZIP and use NSIS), nor for the Mac (dump your executable into an applicationname.app directory and send along some meta data), but for Linux RPM building, it would be helpful to be able to build a Code::Blocks workspace/project file using the command line (not under X) in order to bundle an RPM.

Is this possible? Would anyone appreciate this implementing? I did have a look at the build system source file a while back but have forgotten - is it entirely dependent on wxBase or does it require wx GUI components? If dependent on wxGUI components, it would kill the ability to run entirely on the command line.

BTW, I'm finding the Code::Blocks system to be excellent on GTK+ and Mac (especially given the confusing many-windowed nature of XCode). Keep up the good work!
Apologies if I have missed something obvious.
Title: Re: Codeblocks build system and RPM
Post by: oBFusCATed on March 23, 2010, 04:27:58 pm
At the moment it is not possible to build something without X and unfortunately the X dependency is hard to remove. :(
Title: Re: Codeblocks build system and RPM
Post by: 72deluxe on March 23, 2010, 04:39:32 pm
That's a shame. I suppose that the .cbp file (as it is just XML) could be parsed to extract the build options and flags and target compiler and in order to build a traditional makefile.

Alternatively, if the main frame is not created when doing a batch build from the command line, you could easily bypass the GUI creation and just use stdout to dump build messages. I will look into it!

Thanks anyway
Title: Re: Codeblocks build system and RPM
Post by: oBFusCATed on March 23, 2010, 04:48:12 pm
There is a cbMakefileGen plugin, that can create makefiles, but it is unmaintained and quite buggy :(
Title: Re: Codeblocks build system and RPM
Post by: stahta01 on March 23, 2010, 05:07:32 pm
Another way might be to use Premake or CMake to create the Code::Blocks project.
Or, to use a Custom Makefile for your project.

Note: Premake makes real C::B projects; and, CMake make Custom Makefile projects the last time I checked.

Tim S.
Title: Re: Codeblocks build system and RPM
Post by: Jenna on March 23, 2010, 10:07:08 pm
I once created a ptched version of C::B to run the build-system from a (real) console without the nee of a running xserver.
But I needed very,v ery much #ifdef's to split gui- from non-gui-parts.

C::B is not designed to be easy splittable in a gui and a non-gui part and it's really much work to do so, because the build-system is quite complex.
Great parts of the core-code (and of course the compiler-plugin) have to be redesigned, the code with tons of #ifdef's is not only ugly, but very hard to maintain and therefore error-prone.