[cmake-developers] Imported Locations in FindBoost.cmake

Mike Gelfand mikedld at mikedld.com
Sun Jun 19 15:17:08 EDT 2016


Hello,


On 06/19/2016 02:00 PM, Andreas Weis wrote:
> After fiddling around with the issue, I found that reversing the order
> in which the IMPORTED_LOCATION_* fields on the imported target are being
> set resolves the issue. It seems that the first configuration that's
> added here will be used as a default for the not explicitly added
> configurations?
Seems to be true for me as well. I don't think just reverting the order
is a proper fix though.

Consider exported target configuration files generated by the CMake
itself. They consist of <exported name>.cmake and a set of <exported
name>-<configuration>.cmake files which are included from the former in
unknown order. At east file(GLOB) documentation doesn't specify the
order, but even if it's sorted alphabetically then <exported
name>-debug.cmake always comes before <exported name>-release.cmake or
<exported name>-relwithdebinfo.cmake.

The suggested way to deal with this seems to be to use
MAP_IMPORTED_CONFIG_<CONFIG> target properties, but I suppose it should
only (?) be used when imported target (or target it's being linked to)
has non-standard configurations, which isn't so in this case. Mapping
Release to "Release;RelWithDebInfo" and RelWithDebInfo to
"RelWithDebInfo;Release" looks odd enough (and I didn't add MinRelSize
here). Maybe there should exist some default mapping built-in with the
similar effect?..

Regards,
Mike


More information about the cmake-developers mailing list