Re: [boost] [cmake] Minimum viable cmakeification for Boost

Am 20.06.2017 2:17 nachm. schrieb "Niall Douglas via Boost" < boost@lists.boost.org>: On 20/06/2017 07:27, P F wrote:
BUILD_SHARED_LIBS is a cmake2-ism and should not be present in modern cmake. Moreover, cmake now supports header only libraries, and BUILD_SHARED_LIBS causes problems with eventual C++ Modules support. The ::hl suffix means "link against the header only library edition", the ::sl suffix means "link against the static library edition" and the ::dl suffix means "link against the dynamic library edition". Err, I tend to highly disagree here. As a library author, I can not know if my users need a static or shared library. For a header only library, this hardly matters. Having those different conventions greatly increases the complexity for consuming your library (which do I need again in which circumstances?) so we need to depend on variables to link against the right target (so much for cmake2isms). Some bikeshedding over those names occurred off list. They don't hugely matter, they could be boost::system::header, boost::system::static and boost::system::shared if you wanted. Some bikeshedding also occurred over what boost::system with no suffix should mean. I recommend "whatever library edition the maintainer recommends as the best one" which is NOT necessarily the header only edition. For example, in the future with C++ Modules support the additional suffixs ::hlm, ::slm and ::dlm will be needed. Or longer named, boost::system::header_module, boost::system::static_module and boost::system::shared_module. So if C++ Modules were available, the maintainer might recommend the ::dlm variety, but recommend the ::hl variety if they weren't available. I think that will hugely vary per library as C++ Modules won't necessarily be always a win. Also, end users may wish to assemble all of Boost into a single C++ Module. We don't want to get in the way.
That was intentional. Some bikeshedding occurred over that too with respect to which Boost library guaranteed to be a dependency for all other libraries ought to host the version setting script. Boost.Config is most likely. So the above is a placeholder.
That part is there solely to enable modular build. If you don't want to bother with modular build as this is a bare minimum viable cmakeification, you can eliminate it.
- There is no installation of the targets
Not necessary right now, so out of scope.
As I've repeatedly explained now, installation logic is best implemented by a rootmost CMakeLists. Not in the per-library CMakeLists. We do tell cmake what targets are used by installation via install(TARGETS ...). That's the bare minimum needed for other cmake to implement the remaining installation logic. (On wider picture stuff, install paths need to be absolute I've found, whereas build paths can usually be relative. Relative paths are much nicer during build. In a rootmost CMakeLists which implements some installation logic, you'd iterate the targets for the Boost libraries and configure each programmatically for the appropriate install for that library and that type of library. All the metadata you need to make decisions is available) Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/ _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/ mailman/listinfo.cgi/boost

Thomas Heller wrote:
Err, I tend to highly disagree here. As a library author, I can not know if my users need a static or shared library.
You don't have to know. You provide library::static and library::shared targets, they link to whatever they prefer.

Am 20.06.2017 4:20 nachm. schrieb "Peter Dimov via Boost" < boost@lists.boost.org>: Thomas Heller wrote: Err, I tend to highly disagree here. As a library author, I can not know if
my users need a static or shared library.
You don't have to know. You provide library::static and library::shared targets, they link to whatever they prefer. That's problematic. There are platforms which don't allow for shared libraries. Is the implication that I always have two sets of binaries lying around? Sometimes, objects need to be built differently, so I'll get to build everything twice by default? That does not sound like a great advantage and I miss the argument where BUILD_SHARED_LIBS actually fails to deliver. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman /listinfo.cgi/boost

Am 20.06.2017 4:31 nachm. schrieb "Peter Dimov via Boost" < boost@lists.boost.org>: Thomas Heller wrote:
I don't understand what you're saying here. Having two targets doesn't mean that both get built. If the project links to the target, it gets built, otherwise not. If I want to distribute my library in compiled form, I need to provide both, no? _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman /listinfo.cgi/boost

Am 20.06.2017 4:47 nachm. schrieb "Thomas Heller"
I don't understand what you're saying here. Having two targets doesn't mean that both get built. If the project links to the target, it gets built, otherwise not. If I want to distribute my library in compiled form, I need to provide both, no? Doesn't make a lot of sense. I have to either way... The difference is that I have to decide which target to use eventually. So it's a question which solution puts more burden on the developer, which I'm not sure about right now... _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman /listinfo.cgi/boost
participants (2)
-
Peter Dimov
-
Thomas Heller