With ExternalProject_Add, you have to specify the location of boost that you have built/installed directly to the thing that wants to know where it is. It cannot use FIND_PACKAGE to find boost until after boost is built/installed.<div>
<br></div><div>So you would specify boost&#39;s location to the later projects that depend on it by using a -D argument to tell it where it is directly. Then there is no &quot;finding&quot; required.</div><div><br></div><div>
I don&#39;t know if this is easily do-able with Boost and ExternalProject_Add... (mainly because I&#39;m not that familiar with boost usage...) but we certainly do it all the time with packages like VTK. The project that depends on VTK gets a -D VTK_DIR to tell it where it is so that find_package is a no-op find, but just defines the right variables in terms of that VTK_DIR.</div>
<div><br></div><div>I would think boost should be similar, but I know it&#39;s more complex than that just by listening in on lists like this...</div><div><br></div><div><br></div><div>Hopefully this helps to clarify rather than muddy things a bit,</div>
<div>David Cole</div><div>Kitware, Inc.</div><div><br><br><div class="gmail_quote">On Wed, Mar 24, 2010 at 5:04 PM, Michael 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="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I have been playing with &quot;ExternalProject_Add&quot; and I don&#39;t think you are going to be able to do what you are trying to do. I was using the following:<br>

<br>
project (Combined)<br>
cmake_minimum_required(VERSION 2.8)<br>
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)<br>
<br>
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY �${PROJECT_BINARY_DIR}/Bin )<br>
<br>
# --------- Setup the Executable output Directory -------------<br>
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin )<br>
<br>
# --------- Setup the Executable output Directory -------------<br>
SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin )<br>
<br>
set (EP_BASE &quot;Boost&quot;)<br>
ExternalProject_Add(<br>
 � �Boost<br>
 � � � � � � � �TMP_DIR Boost/tmp<br>
 � � � � � � � �STAMP_DIR Boost/stamp<br>
 � � � � � � � �DOWNLOAD_DIR Boost/Download<br>
 � �DOWNLOAD_COMMAND &quot;&quot;<br>
 � �SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../MXABoost<br>
 � � � � � � � �CMAKE_ARGS -DBOOST_INCLUDE_INSTALL_DIR=include/boost-1_36 -DBUILD_SOVERSIONED=OFF -DBOOST_LIB_INSTALL_DIR=lib -DENABLE_DEBUG=ON -DENABLE_MULTI_THREADED=ON -DENABLE_RELEASE=ON -DENABLE_SHARED=OFF -DENABLE_SINGLE_THREADED=OFF -DENABLE_STATIC=ON -DINSTALL_VERSIONED=OFF -DWITH_MPI=OFF -DWITH_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/Boost/Install<br>

 � �BINARY_DIR Boost/Build<br>
 � � � � � � � �BUILD_COMMAND make -j16<br>
 � �INSTALL_DIR Boost/Install<br>
)<br>
<br>
set ($ENV{BOOST_ROOT} &quot;${PROJECT_BINARY_DIR}/Boost/Install&quot;)<br>
set (BOOST_ROOT &quot;${PROJECT_BINARY_DIR}/Boost/Install&quot;)<br>
# ---------- Find Boost Headers/Libraries -----------------------<div class="im"><br>
SET (Boost_FIND_REQUIRED TRUE)<br>
SET (Boost_FIND_QUIETLY TRUE)<br>
set (Boost_USE_MULTITHREADED TRUE)<br>
set (Boost_USE_STATIC_LIBS TRUE)<br>
SET (Boost_ADDITIONAL_VERSIONS &quot;1.36&quot; &quot;1.36.0&quot; &quot;1.41&quot; &quot;1.41.0&quot; &quot;1.39&quot; &quot;1.39.0&quot;)<br>
<br></div>
# --------------------------------------------------------------------<br>
# MXA_BOOST_HEADERS_ONLY determines if any boost libraries are going to<br>
# be found with the boost headers. For MXADataModel itself NO boost<br>
# libraries are required but if you choose to build the ImportGenerator<br>
# program then you will need the boost program_options library.<br>
if ( NOT MXA_BOOST_HEADERS_ONLY)<br>
�set (MXA_BOOST_COMPONENTS program_options )<br>
endif()<br>
<br>
include(${PROJECT_BINARY_DIR}/Boost/Install/share/cmake/boost/BoostConfig.cmake)<br>
#FIND_PACKAGE(Boost COMPONENTS �${MXA_BOOST_COMPONENTS} )<div class="im"><br>
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})<br>
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})<br>
<br></div>
The problem is that all the files that Find_package() would normally use are NOT available the first time CMake is run. They would ONLY be available after boost is compiled and installed. So this seems to be a chicken-and-egg thing. Not sure what to do except ask on the CMake Users Mailing list.<br>

<br>
sorry<div class="im"><br>
___________________________________________________________<br>
Mike Jackson � � � � � � � � � � �<a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer � � � <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software � � � � � � � Dayton, Ohio<br>
<br>
<br></div><div><div></div><div class="h5">
On Mar 24, 2010, at 3:56 PM, Brian Davis wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
<br>
<br>
On Wed, Mar 24, 2010 at 2:44 PM, Michael Jackson &lt;<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>&gt; wrote:<br>
The Boost-CMake (IMHO) sort of &quot;abused&quot; the cmake system somewhat in order to make it more &quot;bjam&quot; like.<br>
<br>
In practice if the first pass of FindBoost.cmake does not find anything then I usually have to manually go into the CMakeCache.txt file and remove all the boost variables and re-run CMake. You can also probably do this using the CMake-Gui program.<br>

<br>
<br>
I posted a desirement in the CMake Mantis bug tracker only to find out that all one has to do in CMake GUI is File-&gt;&quot;Delete Cache&quot; then config, config, generate, wait for CMake VS Macros to notice something is awry and update the pojects... I still wish there were a button. �If I could get a heart rate monitor to sense my level of frustration and automatically rerun a script to delete the cache I think this would be the optimal solution.<br>

<br>
<br>
Basically for each library, look in boost/libs/filesystem/CMakeLists.txt. That file should get you started in the right location to start trying to figure out what is going wrong.<br>
<br>
<br>
Thanks for the words of advice I will keep hacking until I find out what I am doing wrong.<br>
<br>
Brian<br></div></div><div class="im">
_______________________________________________<br>
Boost-cmake mailing list<br>
<a href="mailto:Boost-cmake@lists.boost.org" target="_blank">Boost-cmake@lists.boost.org</a><br>
<a href="http://lists.boost.org/mailman/listinfo.cgi/boost-cmake" target="_blank">http://lists.boost.org/mailman/listinfo.cgi/boost-cmake</a><br>
</div></blockquote><div><div></div><div class="h5">
<br>
_______________________________________________<br>
Boost-cmake mailing list<br>
<a href="mailto:Boost-cmake@lists.boost.org" target="_blank">Boost-cmake@lists.boost.org</a><br>
<a href="http://lists.boost.org/mailman/listinfo.cgi/boost-cmake" target="_blank">http://lists.boost.org/mailman/listinfo.cgi/boost-cmake</a><br>
</div></div></blockquote></div><br></div>