[cmake-developers] IMPORTED targets for some Find modules

Philipp Moeller bootsarehax at gmail.com
Wed Jun 25 09:37:03 EDT 2014


Nils Gladitz <nilsgladitz at gmail.com>
writes:

> On 06/25/2014 02:53 PM, Stephen Kelly wrote:
>> David Cole via cmake-developers wrote:
>
>> Thanks. That indeed doesn't seem to interact well with CMake.
>>
>> The introduction of imported targets is an opportunity to add the necessary
>> define to disable it to INTERFACE_COMPILE_DEFINITIONS by default, if that is
>> desired.
>
> I would like that very much as well.

I'll look into doing that. I think populating
INTERFACE_COMPILE_DEFINTIONS with BOOST_${LIBRARY_NAME}_NO_LIB seems the
obvious choice. In addition I can provide a Boost::disable_autolinking
target to disable it for the complete library.

> I've got a custom FindBoost.cmake which basically just wraps the
> actual FindBoost module and sets the "BOOST_ALL_NO_LIB" definition.

Another option is to wrap FindBoost and simply unset ${Boost_LIBRARIES}
on Windows after it completed and to make sure the link directories are
set.

> This seems to be a source of confusion for people who are unaware of
> autolinking in general.
>
> Having CMake find and link one set of libraries (DLL by default) and
> the lib pragmas link yet another set of libraries (static by default).





More information about the cmake-developers mailing list