[CMake] Target_link_libraries imported library

Stephen Kelly steveire at gmail.com
Thu May 14 12:06:13 EDT 2015


Lars wrote:

> 
> There is one problem with this setup and that is the
> IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE contains a static path to a
> boost lib. So the "c:\boost\lib\boost_filesystem-vc110-mt-1_55.lib" is
> appended to the linking of "bar-library" and this will fail if the path is
> incorrect. We cannot guarantee that boost is located at the same path on
> all Windows system. So how can we remove or update the boost path?

The cmake-packages(7) manual in master describes this case (and used to 
mention Boost explicitly)

 http://www.cmake.org/cmake/help/git-master/manual/cmake-packages.7.html#creating-relocatable-packages

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3af13782

Another option not listed at the end there would be to create IMPORTED 
targets for Boost yourself and maintain that. You could create a wrapper 
around FindBoost.

The ideal situation would be for Boost to ship cmake-config-packages itself, 
but that suggestion doesn't get much support from Boost devs (probably 
because they are not cmake fans :) ).

Thanks,

Steve.



More information about the CMake mailing list