Boost logo

Boost :

Subject: [boost] build directory guidelines (was: [histogram] review part 1 (documentation))
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2018-09-19 10:18:05


On Tue, 18 Sep 2018 at 22:54, Steven Watanabe via Boost
<boost_at_[hidden]> wrote:
> On 09/18/2018 02:04 PM, Hans Dembinski via Boost wrote:
> > <snip lots>
> >> - Is there a reason that CMakeLists.txt is in
> >> build/ instead of test/?
> >>
> >
> > Mateusz moved the CMakeLists.txt into the root directory which is
> > better/more straight forward and follows the example of hana and compute.
> > We could also move it to test as you suggest, but I prefer it in the root
> > directory.
> > I read in some Boost guides (I think it was on the blincubator, but I can't
> > find the source just now and blincubator.com gives me a 403 error today)
> > that all build scripts should reside in the build directory or next to the
> > source. So I put it in "build".
> >
>
> That's not the correct interpretation of the guideline
> (perhaps it needs to be stated more clearly as you're
> not the first to make that mistake).

I believe it deserves clarification

https://www.boost.org/development/requirements.html says

- build
- Library build files such as a Jamfile, IDE projects, Makefiles,
Cmake files, etc.
- Required if the library has sources to build.

It is unclear if the "sources to build" are meant strictly as the library
compilation input sources only, or also auxiliary sources of the library
as a project (ie. tests, examples).

> I would probably put
> CMakeLists.txt in test/ with an (optional) root CMakeLists.txt
> that just calls add_subdirectory.

I tend to put the root CMakeLists.txt
- it is convenient to drive build of everything in the library
- it indicates if the library is CMake-enabled, without browsing deeper

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk