18 Jun
2017
18 Jun
'17
3:55 a.m.
> On Jun 17, 2017, at 3:10 PM, Robert Ramey via Boostwrote: > > On 6/17/17 11:42 AM, P F via Boost wrote: >>> Hmmm - I would be curious if a CMake enthusiast took a look at the Safe Numerics repo and commented on the CMake files listed there. I think its pretty simple and canonical usage of CMake as it relates to a Boost library. The only think I want to change is the existence of some code in a CMake directory which I'll soon eliminate - but all in all it's pretty simple. What would be missing from this for it it to meet expectations of CMake Promotors? >> * It should not use global `include_directories`. >> * Its not necessary to put CMakeLists.txt in every directory with modern cmake. >> * There is no installation, and there is no support for `find_package(SafeNumerics)` which can provide a cmake target for downstream user to use. Nor does it provide a cmake target for people to use with `add_subdirectory` either. >> * Tests are always built even when the user sets `BUILD_TESTING` to off. >> Boost.Hana is much better example of modern cmake. > > Thanks for looking at this - the comments above really make me see that even having spend a lot of time trying to figure out CMake - there is still a lot I don't know. I have questions on each point above, but they are not relevant to this thread so I'll move on. > > I also looked at Hana usage of CMake. I have to say it's quite off-putting for a library author to be required to learn a huge amount of CMake lore and prepare 500 lines of script across several files just to submit a header only library which. I agree which is why I am writing cmake modules to help make this more straightforward. > > * only needs to run tests > * users need only point to the header library. A header-only library needs to do more than this. It needs to install the headers as well as the usage requirements(through exporting the target) > > Actually, this example makes bjam look much easier than CMake which I believe conflicts with the original premise which motivated the proposal. I don’t think its a fair comparison to bjam as its not doing the same thing. The bjam files in boost for header-only libraries do not individually install headers or usage requirements.