<div dir="ltr">If project Y needs to link to project X, you could build project Y with ExternalProject_Add and list project X in the DEPENDS parameter.<div><br></div><div><a href="http://www.cmake.org/cmake/help/v3.0/module/ExternalProject.html">http://www.cmake.org/cmake/help/v3.0/module/ExternalProject.html</a><br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 13, 2014 at 9:39 AM, Hans van den Bogert <span dir="ltr"><<a href="mailto:hansbogert@gmail.com" target="_blank">hansbogert@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I see thanks, so install_dir has a different meaning than the eventual install dir of the external project, I thought there would be some ‘magic’ where the ExternalProject functions would override the the prefix of, in this case, project x.<br>

<br>
I still have one issue, perhaps I should start a new thread,  but here goes:<br>
<br>
The external project produces a library, how can I make that library a target, so that any executables in the main project who depend on the library from ‘x’ will not link before the library is compiled/available.<br>
<br>
Because I some instances if I have a parallelized build the following scenario can happen.<br>
<br>
1) x is being built<br>
1) an executable which depends on an library, libx, from ‘x’ is being built.<br>
2) the executable proceeds to its linking phase, but needs libx, which is not there; build fails.<br>
3) ‘x’ has now produced libx<br>
<br>
libx was produced too late.<br>
<br>
<br>
My current setup (which exhibits the above) is simply to deduce the complete path to the library and add it the executable target.<br>
<br>
Is there any way this can be fixed with custom targets or something related?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On 13 Aug 2014, at 15:23, David Cole <<a href="mailto:dlrdave@aol.com">dlrdave@aol.com</a>> wrote:<br>
<br>
> See, for example:<br>
><br>
> <a href="https://github.com/OpenChemistry/openchemistry/blob/master/CMakeLists.txt#L24" target="_blank">https://github.com/OpenChemistry/openchemistry/blob/master/CMakeLists.txt#L24</a><br>
><br>
> A common CMAKE_INSTALL_PREFIX is used for all OpenChemistry ExternalProject builds that are driven by CMake.<br>
><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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Christopher Mullins<div>R&D Engineer</div><div>Kitware Inc.,</div><div>919.869.8871</div>
</div>