<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Yes this looks like an option.&nbsp; Thanks for the lead.&nbsp; It is not quite what I was expecting.&nbsp; <br><br>This seems specific to Boost Libraries.&nbsp; Which brings up 2 questions:<br><br>Is there a generic way do this for any third party source tree?<br> Is there going to be CMAKE variable name resolution clash potential without namespace resolution within CMake (or is there already this problem or have I missed something)?<br><br>What I would like to do is set (please bear with me as I am a complete nube to CMake)<br> <br>BUILD_PROJECTS=none<br><br>Then do<br><br>add_subdirectory(boost_source_dir)<br><br>project( my_exe )<br>add_executable( my_exe mysource.cpp )<br>add_library( boost_filesystem &nbsp; SHARED)<br>#An IMPORTED library target references a library file located outside the project.  No rules are generated to build it.  &lt;- Too bad about this last statement<br> <br>or<br><br>add_dependencies( my_exe boost_filesystem )<br><br><br>Is there any mechanism for project level resolution of third party source targets such as in bjam boost//boost_filesystem<br><br>project<br>&nbsp;&nbsp;&nbsp; : requirements &lt;library&gt;../build//boost_filesystem<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;library&gt;/boost/system//boost_system<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hardcode-dll-paths&gt;true<br>&nbsp;&nbsp;&nbsp; ;<br><br><br>project boost/filesystem<br>&nbsp;&nbsp;&nbsp; : source-location ../src<br>&nbsp;&nbsp;&nbsp; : usage-requirements # pass these requirement to dependents (i.e. users)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link&gt;shared:&lt;define&gt;BOOST_FILESYSTEM_DYN_LINK=1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;link&gt;static:&lt;define&gt;BOOST_FILESYSTEM_STATIC_LINK=1<br>&nbsp;&nbsp;&nbsp; ;<br><br>And boost_filesystem's use:<br><br>project <br>&nbsp;&nbsp;&nbsp; : requirements<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;library&gt;/boost/filesystem//boost_filesystem<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;toolset&gt;msvc:&lt;asynch-exceptions&gt;on<br>&nbsp;&nbsp;&nbsp; ;<br><br>where some syntax like:<br><br>add_subdirectory(boost_source_dir PROJECT boost )<br><br>add_dependencies( my_exe boost//boost_filesystem )<br> <br>or<br><br>add_library( boost//boost_filesystem &nbsp; SHARED)<br><br><br>allowing the specification and namespace resolution of the 3rdParty (boost) library<br><br>I know above does not exist as my example question shows, but if it does in some other form what is it?<br> <br>Brian<br><br><div class="gmail_quote">On Sat, Dec 5, 2009 at 3:45 PM, Mike Jackson <span dir="ltr">&lt;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> I _think_ you _might_ be able to set the BUILD_PROJECTS to<br> "file_system;system" then do the "add_subdirectory()".<br> &nbsp;Give it a shot and see what happens.<br> <br> _________________________________________________________<br> Mike Jackson &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a><br> BlueQuartz Software &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br> Principal Software Engineer &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Dayton, Ohio<br> <div><div></div><div class="h5"><br> <br> <br> On Sat, Dec 5, 2009 at 4:15 PM, Brian Davis &lt;<a href="mailto:bitminer@gmail.com">bitminer@gmail.com</a>&gt; wrote:<br> &gt;<br> &gt; I have used boost jam before and there was a mechanism to build only what<br> &gt; you need by specifying dependencies within the boost libraries.&nbsp; bjam would<br> &gt; then run off calculate deps and build only what I needed. In CMake is there<br> &gt; such a feature to specify a third party library and specify only the targets<br> &gt; you need to build as dependencies of my build target?<br> &gt;<br> &gt; i.e. can I use<br> &gt;<br> &gt; add_subdirectory( lib/3rdParty/Win32/boost-cmake-1_41_0 ./boost )<br> &gt;<br> &gt; then create a target that only uses say boost_filesystem and only have that<br> &gt; built? Or do I need to build the world to get a handful of needed dll's that<br> &gt; are actually used in my project?<br> &gt;<br> &gt; --<br> &gt; Brian J. Davis<br> &gt;<br> &gt;<br> </div></div>&gt; _______________________________________________<br> &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br> &gt;<br> &gt; Visit other Kitware open-source projects at<br> &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br> &gt;<br> &gt; Please keep messages on-topic and check the CMake FAQ at:<br> &gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br> &gt;<br> &gt; Follow this link to subscribe/unsubscribe:<br> &gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br> &gt;<br> </blockquote></div><br><br clear="all"><br>-- <br>Brian J. Davis<br><br></body></html>