News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Codeblocks build system and RPM

Started by 72deluxe, March 23, 2010, 03:39:10 PM

Previous topic - Next topic

72deluxe

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.

oBFusCATed

At the moment it is not possible to build something without X and unfortunately the X dependency is hard to remove. :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

72deluxe

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

oBFusCATed

There is a cbMakefileGen plugin, that can create makefiles, but it is unmaintained and quite buggy :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Jenna

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.