Boost logo

Boost-Build :

From: Robert Ramey (ramey_at_[hidden])
Date: 2021-02-24 19:48:56


On 2/24/21 7:46 AM, Paul A Bristow via Boost-build wrote:
> Having spent a decade watching the Cmake versus bjam/b2 battle, I had thought it wise to wait until the dust has settled.
>
> It would appear that the enthusiasm for CMake and Boost is much greater among consumers than producers ☹
>
> But recently I have been working on a project that is possible Boost library and thought that I would dip my toe in the water.
>
> After some research, I am still puzzled how I should replace a simple b2/bjam program (say a classic “hello World”) that is run like this
>
> \example > b2 -a toolset=msvc,gcc,clang cxxstd=14 release > my_log.log
>
> The jamfile contains
>
> run hello_world.cpp ; # Simplest hello_world, no other includes apart from iostream.
>
> And the b2 run .log contains some outputs of "Hello world" and 3 nice **passed** lines and ...updated 3(?) targets..., one for each compiler (and version too, perhaps with some potentially using build info too), and return exit_success value.
>
> (I also would expect to get a simple setup to run a test using the /included version of unit_test_framework.
> Trying to walk before I fall over running, I have avoided any pre-compiler libraries, at least at first.)
>
> After some research (getting as far as generating a Visual Studio project, where I can intervene manually to build and run my hello_world program),
> I am still unclear how to replicate this b2 test to end with a .exe run and some log file with pass/fail indications.
>
> I am of course building on Windows 10 with three recent versions of MSVC, GCC and Clang compilers working, and in my bjam/b2 user-config.jam.
>
> Advice from less-than-novice CMakers most welcome.

You might check out the serialization and/or the safe numerics library.
  They are a little different projects. One is header only while the
other isn't. The serialization library CMake is a little older and
structures the CMake.txt files a little differently. But in both cases
they are designed to run all the tests.

serialization:

It has a very elaborate bjam file in the test directory. It builds all
the required boost componenents, the serialization library itself and
runs all the tests. The "equivalent" (as far as I can make it) CMake ...
I use to build the IDE. From the IDE (xcode in my case) I pick targets
(e.g. BUILD_ALL, RUN, ... or some specific target (test) name) and
invoke the IDE. Works pretty well. Once I've got things debugged, I
re-run the same thing with b2 to make sure everyone is in agreement.
Then I check-in.

My motivation for spending time with CMake was to be able to use an IDE
without constantly syncing it with the bjam settings. This is a problem
I had using the IDE with windows. All in all I'm pleased with the whole
mess.

safe numerics

header only library with both compile and execute tests. A more modern
CMake.txt layout.

FYI - I consider myself a novice CMake user. But then I also consider
myself a novie B2 user.

So, truth be told, I actually like CMake and B2 - I see them as useful
in different ways. Of course hey both make one pull his hair out in
different ways also.

Robert Ramey

>
> Thank you.
>
> Paul
>
>
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
>


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk