<div dir='auto'>Hello,<div dir="auto"><br></div><div dir="auto">Tx for the idea !</div><div dir="auto">That would work to "boostrap" the build but I'm not very fond of it due to it's "static" nature : it would run only once during the initial cmake run.</div><div dir="auto"><br></div><div dir="auto">We extract versionning information from git tags : in our current (slow) build system, a git update can trigger a "rpm" update with a newer version, so it has to be more "dynamic".</div><div dir="auto"><div dir="auto"><br></div><div dir="auto">I was thinking maybe of creating links in our build tree (they would be the output of a add_custom_command) so it's ok to clean them. Creating them would involve installing the package then creating the link from the build dir to the "rpm" repo.</div><div dir="auto"><br></div><div dir="auto">I think that would work but I hope there is a simpler solution.</div><div dir="auto"><br></div><div dir="auto">Is it possible for external projects not to be cleaned for example ?</div><div dir="auto"><br></div><div dir="auto">With regards,</div><div dir="auto"><br></div><div dir="auto">David<br><div dir="auto"><br><div class="gmail_extra"><br><div class="gmail_quote">Le 20 janv. 2017 22:13, Tamás Kenéz <tamas.kenez@gmail.com> a écrit :<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Maybe executing your script in configure time (execute_process)?</div><div><br><div class="elided-text">On Fri, Jan 20, 2017 at 4:36 PM,  <span dir="ltr"><<a href="mailto:david.jobet@free.fr">david.jobet@free.fr</a>></span> wrote:<br><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Hello,<div dir="auto"><br></div><div dir="auto">I'm working on a project where some of our libs depend on custom build of some external libraries.</div><div dir="auto">Those external libraries are managed through a repository manager similar to rpm (redhat package manager) which allows us to retrieve pre-compiled versions with related header files. (similar to devel packages)</div><div dir="auto"><br></div><div dir="auto">The catch is we want libraries to be downloaded automatically to a shared (multiple users) local dir __AND__ we don't want them to be cleaned. (because another user could be using it).</div><div dir="auto"><br></div><div dir="auto">I've tried add_custom_command but files disappear with make clean.</div><div dir="auto">I've tried to set NO_CUSTOM_CLEAN, that works with make but not with ninja.</div><div dir="auto"><br></div><div dir="auto">I've tried to chain add_custom_target to download the file and add_dependencies, again, this works with make but not with ninja (ninja does not know how to create protocol buffer compiler "protoc" for example since it's not the output of any command he knows)</div><div dir="auto"><br></div><div dir="auto">I've tried externalproject_add with BUILD_BYPRODUCTS but it looks like ninja still clean the downloaded files.</div><div dir="auto"><br></div><div dir="auto">Any idea on how to make ninja not clean those downloaded files (we use generators like protoc, libraries and header files)</div><div dir="auto"><br></div><div dir="auto">With regards</div><div dir="auto"><br></div><div dir="auto">David</div><div dir="auto"><br></div><div dir="auto">PS : in my add_custom_command/add_custom_<wbr>target, I invoke "cmake -P" on a custom cmake script with 2 args. The first arg is a file to test for existence, the second one is the parameter to our custom "rpm" to download the package.</div></div><br>--<br>
<br>
Powered by <a href="http://www.kitware.com">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">http://www.cmake.org/Wiki/<wbr>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">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake">http://public.kitware.com/<wbr>mailman/listinfo/cmake</a><br></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></div>