Subject: Re: [boost] Proposal for moving Boost to CMake
From: P F (pfultz2_at_[hidden])
Date: 2017-06-19 15:14:57
> On Jun 19, 2017, at 3:58 AM, Olaf van der Spek via Boost <boost_at_[hidden]> wrote:
> On Sat, Jun 17, 2017 at 3:36 PM, P F via Boost <boost_at_[hidden]> wrote:
>> It would be nice to not just support cmake, but pkgconfig as well. There are many times I need to use boost in non-cmake projects, so having pkgconfig would be helpful as well.
> I don't really get find_package and pkgconfig etc.
> I use package management to install the dependencies I need.
> I then include and link to the stuff I need. It'd be nice if the
> linking was automatic like it is on MSVC but okay.
> Why does one need all kinds of extra complexity in every single make
> file for things like find_package or pkgconfig?
I find writing something like `g++ $(pkgconfig boost_asio --cflags âlibs) foo.cpp` much easier to write. In fact, I would need some investigating to know what flags I need. Other users would like boost to support pkgconfig as well as there are tickets open for this. Almost the same applies for `find_package` in cmake as well.
It doesnât add too much complexity. The files for pkgconfig are a simple text format, and for find_package, cmake can already generate the code the exported target. What is different is that all the dependencies between boost libraries are explicit. So the `boost_core-config.cmake` look like this:
# Include the targets generated by cmake
And then targets file is generate by calling `install(EXPORT boost_core-targets FILE FooTargets.cmake DESTINATION lib/cmake/boost_core)` in the main CMakeLists.txt.
I actually wrote BCM to help reduce this boilerplate, here:
However, I planning to refactor this from feedback I got.