<div dir="ltr">As far as I am aware the Boost find module doesn't support writing out import targets.<div><br></div><div>As far as setting up interface libraries for imported tagets you want to use the</div><div>IMPORTED_LINK_INTERFACE_LIBRARIES and IMPORTED_LINK_INTERFACE_LIBRARIES_<CONFIG> properties.<br></div><div><br></div><div>Here is an example:</div><div><br></div><div><div>set_target_properties(Filters PROPERTIES</div><div>  IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG "Common;/usr/local/lib/libzmq.3.dylib"</div><div>)</div></div><div><br></div><div>Note that Common in this example is another imported target.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 23, 2014 at 12:53 PM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for the reply!<br>
<br>
Basically the boost library I have is precompiled and in my own unique<br>
structure. I do not plan to distribute the CMake scripts I write, they<br>
are for personal / internal usage only.<br>
<br>
You suggested a find module, but will this also generate a custom<br>
target for boost? That's important so that when I do<br>
target_link_libraries(), I can pass in "boost" and everything is<br>
handled for me. I do not want to be working with libs & header files<br>
directly in each executable or library I define that has a dependency<br>
on boost.<br>
<br>
Thanks again.<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Oct 23, 2014 at 4:59 AM, Johannes Zarl <<a href="mailto:johannes.zarl@jku.at">johannes.zarl@jku.at</a>> wrote:<br>
> Hi,<br>
><br>
> Assuming you are not a boost developer / your changes won't be upstreamed,<br>
> then creating a BoostConfig.cmake file won't do you much good. If someone wants<br>
> to use your project, he/she will have to patch the locally installed boost<br>
> version to include a BoostConfig.cmake file.<br>
><br>
> You might want to have a look into the FindBoost[1] module of cmake.<br>
><br>
> XXXConfig.cmake files are intended to be written by the creator of a package,<br>
> FindXXX.cmake packages are intended as a workaround when a package does not<br>
> contain an XXXConfig.cmake file and are usually written by a consumer of a<br>
> package.<br>
><br>
> HTH,<br>
>   Johannes<br>
><br>
> [1] <a href="http://www.cmake.org/cmake/help/v3.0/module/FindBoost.html" target="_blank">http://www.cmake.org/cmake/help/v3.0/module/FindBoost.html</a><br>
><br>
> On Friday 17 October 2014 00:18:34 Robert Dailey wrote:<br>
>> I have a local package of boost built on Windows. It is always<br>
>> relative to the root of my project at a consistent structure and<br>
>> location. I wanted to define an import target for this and thought it<br>
>> might be best to define a BoostConfig.cmake package config file at the<br>
>> root of the boost lib directory. Is this the right approach? The code<br>
>> is below.<br>
>><br>
>> Note that I do not have this working just yet because I don't know how<br>
>> to properly setup the interface link libraries. Could use some<br>
>> guidance here too... thanks.<br>
>><br>
>> add_library( Boost STATIC IMPORTED GLOBAL )<br>
>><br>
>> file( GLOB boost_debug_libs ${CMAKE_CURRENT_LIST_DIR}/lib/win32/debug/*.lib<br>
>> ) file( GLOB boost_release_libs<br>
>> ${CMAKE_CURRENT_LIST_DIR}/lib/win32/release/*.lib )<br>
>><br>
>> set_target_properties( Boost PROPERTIES<br>
>>     IMPORTED_LOCATION_DEBUG lib/win32/debug<br>
>>     IMPORTED_LOCATION_RELEASE lib/win32/release<br>
>>     INTERFACE_INCLUDE_DIRECTORIES include<br>
>>     INTERFACE_LINK_LIBRARIES<br>
>>         $<$<CONFIG:Debug>:${boost_debug_libs}><br>
>>         $<$<CONFIG:Release>:${boost_release_libs}><br>
>> )<br>
>><br>
>> set( Boost_INCLUDE_DIRS include )<br>
>> set( Boost_LIBRARIES Boost )<br>
><br>
> --<br>
><br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
><br>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
><br>
> CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>