<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Steph,<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">what you want to achieve is better known as a *Superbuild* in the CMake world. You have several options here, but the most basic one is probably the following:<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">You setup another repository which only builds all the external dependencies (such as Qt) and put them in a predefined place. In your actual project you could refer to those prebuilt libraries using the CMAKE_PREFIX_PATH variable, which should point to the install directory from your external build. This way all the external stuff will only be build once (probably via CI) and all your developers don't need to build all the dependencies themselves.<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Regarding the external package introspection. You could use find_package() to check, if the correct version of your external library has been found on the system and just use it. In any other case you check for the _NOTFOUND variable and set it up locally, with the installation target pointing to the CMAKE_PREFIX_PATH as mentioned above.<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">On a personal note, I would not use such a build system layout myself, as it quickly becomes unclear from where a dependency is coming from and if the dependency has all the required flags and settings as needed for the software project. So you might want to reconsider a more cleaner layout. For inspiration you may have a look at the CMake configuration of the OpenChemistry project [1].<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Greetings<br><br>[1] <a href="https://github.com/OpenChemistry/openchemistry">https://github.com/OpenChemistry/openchemistry</a><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-family:tahoma,sans-serif">Kai Wolf<br><br></span>
<span style="font-family:tahoma,sans-serif"><a href="http://kai-wolf.me/" target="_blank">http://kai-wolf.me/</a><br></span></div><span style="font-family:tahoma,sans-serif"><a href="mailto:kai.wolf@gmail.com" target="_blank">kai.wolf@gmail.com</a><br></span></div></div></div></div></div>
<br><div class="gmail_quote">2018-03-05 11:59 GMT+01:00 Stéphane Ancelot <span dir="ltr"><<a href="mailto:sancelot@numalliance.com" target="_blank">sancelot@numalliance.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I need some external libraries in my project (eg a particular version of qt..)<br>
<br>
These external projects have been cloned locally , I could use ExternalProject_Add to clone it in my project.<br>
<br>
My major problem is that I will compile it each time and this is time and disk usage consuming, for each users .<br>
<br>
I sounds to me better to have the compiled version available in my development system and use only header+binaries of this particular release.<br>
<br>
So, the scenario I would like to obtain :<br>
<br>
check if My Qt5 binaries are setted up in my system in a predefined directory (to not overlap with possible system one), if not setted up, then<br>
<br>
clone qt needed release and install it in my predefined system directory once (like /usr/local or a directory shared between users) .<br>
<br>
I hope you understood and it is enough clear ....<br>
<br>
Thanks<br>
<br>
Steph<br>
<br>
<br>
<br>
<br>
<br>
<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMak<wbr>e_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" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/su<wbr>pport.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/co<wbr>nsulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/tr<wbr>aining.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/list<wbr>info/cmake</a><br>
</blockquote></div><br></div></div>