Subject: Re: [boost] Boost CMake update
From: Peter Dimov (lists_at_[hidden])
Date: 2017-10-03 16:58:26
> Hi all,
> So I have been working at converting more of boost tests to cmake
> utilizing the BCM library, here:
This looks pretty good.
A few comments:
bcm/share/bcm doesn't seem the right place. tools/bcm, more likely.
an example, clean and tidy; but I'd like to know what is the suggested way
of keeping this file up to date. At minimum, this line:
needs to be updated per each release; how is this to be done?
I had the version in a separate version.cmake file for this reason; so that
version.cmake could be mass-updated by a script after each release, without
having to either regenerate all CMakeLists files - implying that all local
changes would be lost - or requiring maintainers to keep the version up to
date - which they will not.
A similar question arises with the sources and the dependencies, although
those do not change as often or on such a fixed schedule. (I had those in
separate files as well, for similar reasons, although one could go either
As I already mentioned a number of times, this in my opinion must be
find_package(boost_assert VERSION 1.64.0 EXACT)
because there is never, ever, a scenario in which I want boost_core 1.64.0
to link to boost_assert 1.58.0. (Also, REQUIRED, as otherwise errors are not
target_link_libraries(boost_core INTERFACE boost::assert)
This manual specification of dependencies duplicates the find_package. These
two could potentially be folded into something like
Moving on to
bcm_test(NAME core_addressof_test SOURCES addressof_test.cpp)
In the Jamfile, this is
run addressof_test.cpp ;
which automatically generates a name for the test. It would probably be more
convenient if bcm_test could do that itself as well, including adding a
prefix, so that
declared core_addressof_test, and
bcm_test(SOURCES addressof_test.cpp NAME addressof_test_name)
declared core_addressof_test_name so that one did not have to remember to
prefix everything with core_.
Apart from that, nice work, CMake fans ought to be happy. Needs to be
brought up to date with master though. :-)