Boost logo

Boost :

Subject: Re: [boost] Proposal for moving Boost to CMake
From: P F (pfultz2_at_[hidden])
Date: 2017-06-22 09:30:05

> On Jun 21, 2017, at 8:48 PM, Peter Dimov via Boost <boost_at_[hidden]> wrote:
> Louis Dionne wrote:
>> And here's a minimal XYZConfig.cmake file for a library with compiled sources (I added source files to Hana and turned it into a static library to check this):
> To get back to this... it ain't so easy. On Linux, where the default is --layout=system, you indeed can only have libhana.a and (a link to or something like that).
> But on Windows, `b2 --build-type=complete --with-system toolset=msvc-14.1` gives you this:
> boost_system-vc141-mt-1_65.dll
> boost_system-vc141-mt-1_65.lib
> boost_system-vc141-mt-gd-1_65.dll
> boost_system-vc141-mt-gd-1_65.lib
> libboost_system-vc141-mt-1_65.lib
> libboost_system-vc141-mt-gd-1_65.lib
> libboost_system-vc141-mt-s-1_65.lib
> libboost_system-vc141-mt-sgd-1_65.lib
> libboost_system-vc141-s-1_65.lib
> libboost_system-vc141-sgd-1_65.lib
> and of course compiling with a different toolset would give you the appropriate, different, names. You can have all of these installed simultaneously.
> So boost_system-config.cmake needs to be slightly more elaborate.

Yes. For debug and release variants, I believe you can use the `$<CONFIG>` generator expression:

set_target_properties(boost::system PROPERTIES
  IMPORTED_IMPLIB "$<IF:$<CONFIG:release>,${_IMPORT_PREFIX}/lib/boost_system-vc141-mt-gd-1_65.lib,boost_system-vc141-mt-1_65.lib>"
  IMPORTED_LOCATION "$<IF:$<CONFIG:release>,${_IMPORT_PREFIX}/lib/boost_system-vc141-mt-gd-1_65.dll,boost_system-vc141-mt-1_65.dll>"

Which will pick debug or release based on that. However, to choose between the other variants, we can probably use the `COMPONENTS` arguments in `find_package`. So the user can say `find_package(boost_system COMPONENTS static mt)`, or something like that. We also, probably want to make the components requests transitive as well:


Boost list run by bdawes at, gregod at, cpdaniel at, john at