Menu

Cmake-bacon

big-bass
Attachments
cmake-bacon1.png (97242 bytes)
cmake-bacon2.png (26346 bytes)
cmake-bacon3.png (33715 bytes)
rpm-package-build.png (42755 bytes)

CMAKE BACON

https://sourceforge.net/projects/bassix-gtk3-webkit-browser/files/CMAKE_BUILDS/CMAKE_BACON-4.5.0.tar.gz/download

UPDATED to 4.5.0
Why would you want to do it this way
the reason is
bacon building takes about 20 minutes on the raspberry pi 3
most of that is in the conversion process ( if you use ksh its a lot faster!)
since that step is eliminated when we use cmake the build is very fast
another advantage is we can easily generate a debian package
or maybe something fails to convert and you cant compile the code?
this allows you another chance to compile the code using cmake

I also like the idea of having separated builds one for bacon
one for bacon-gtk-gui and another for bacon-fltk-gui

when working on embedded systems this approach
shows us that cmake could be used with bacon
maybe you have some package build system using source code
no problem now by using cmake note that since this is source code
there is no problem using the rpi4 or a 64 bit machine
it will build on the system you have

dependency

sudo apt-get install cmake

note the screen shot is older but the code to compile is the same
just cd into the directory CMAKE_BACON-4.5.0
then

Step 1

cmake .

screen shot of terminal output

Step 2

cmake --build .

screen shot of terminal output

Step 3

you can type

cpack

and that will generate a new debian package

screen shot of terminal output

and if you double click on the deb package it should install
using your built in default package manager

if you prefer using the older make instead that is possible to

sudo make install

and this can be done too if needed

sudo make uninstall

Notes:
I used debian for the cpack demo
but with a small edit to the code in CMakeLists.txt
you could generate a rpm package
look below in advanced topics for how to do it

if you want the official docs for cmake go here
https://cmake.org/cmake/help/latest/guide/tutorial/index.html


Discussion

  • big-bass

    big-bass - 2021-05-05

    ADVANCED topics

    How to build an RPM package from a debian / ubututu based system when using cmake

    First we need the tools to do the job
    rpmbuild executable must be installed for this to work
    on debian it has a different package name rpm

    sudo apt-get install rpm
    

    then check if it installed and where it is located and the correct name given

    which rpmbuild
    

    /usr/bin/rpmbuild


    now in the CMakeLists.txt

    I already added the needed code but deactivated it by defaut
    with a condition since most people will build rpm on a Redhat based system anyway

    look for this line in CMakeLists.txt
    and change the no to yes
    there is more code to actually build the package (not listed here) but this is how to turn on
    the condition

    #----------------------------------------------------------------------
    # RPM PACKAGE MAKER
    #----------------------------------------------------------------------
    
    # manual hack here you can set it to build with a "yes" or "no" 
    SET(RPM_BUILD "no")
    

    just to be complete here is a screen shot of the terminal out

     

    Last edit: big-bass 2021-05-05

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.