<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'>Okay, well, I hacked it so it would work for me:<br><br>Our code requires a step between cloning and the submodule initalization. All of our code is hosted on a server behind a firewall, so when we are on our network the URL's for the submodules work great. But outside our network, git hardcodes the server names in the submodule URLs so we have a script to see what URL the clone came from and then changes all of the submodule URL's to use that same server. Outside our network, we build an SSH tunnel in and clone through a port forward to our server, so the .gitmodules file needs modified to set that up. <br><br>Anyway, to make the ExternalProject work for me, I had to delete the submodule init section of the clone script. <br><br>Then I could add an extra step between "download" and "update" to run our name-mangling script.<br><br>I also modified the update step in ExternalProject so instead of running "git submodule update --recursive" it now runs "git submodule update --init --recursive" <br><br>I don't know if anybody else has a similar use case as I do so maybe upstream changes are not needed. However, I will say that all of our codes have submodules in them that are not needed for the code to compile -- they are things like documentation or developer scripts/tools -- and so checking them out should be completely optional. It would be good if there was a way to not run the submodule init/update at all during the download or update steps, my odd use case notwithstanding.<br><br>Tim<br><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Tim Gallagher" <tim.gallagher@gatech.edu><br><b>To: </b>"cmake" <cmake@cmake.org><br><b>Sent: </b>Friday, March 13, 2015 1:05:42 PM<br><b>Subject: </b>Re: [CMake] Prevent ExternalProject from updating git submodules<br><br><style>p { margin: 0; }</style><div style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000">Hi Nicholas,<br><br>I tried that and no luck. I've done both:<br><br>ExternalProject_Add(... GIT_SUBMODULES "")<br><br>and<br><br>set(empty_list "")<br>ExternalProject_Add(... GIT_SUBMODULES "${empty_list}")<br><br>and it still tries to update the submodules. I know it's seeing the option -- if I pass in a name of a submodule that doesn't exist, it will crash when it tries to check out that made up one. But I can't seem to get it to not update any of them.<br><br>Tim<br><br><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Nicholas Yue" <yue.nicholas@gmail.com><br><b>To: </b>"tim gallagher" <tim.gallagher@gatech.edu><br><b>Sent: </b>Friday, March 13, 2015 12:52:41 PM<br><b>Subject: </b>Re: [CMake] Prevent ExternalProject from updating git submodules<br><br><div dir="ltr">Hi Tim,<div><br></div><div style="">  I use external project but not the GIT_SUBMODULES but maybe the following might work</div><div style=""><br></div><div style="">  (1) Create an empty list</div><div style="">  (2) set <span style="font-size:13px">GIT_SUBMODULES to that empty list</span></div><div><br></div><div style="">Cheers</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 13 March 2015 at 09:43, Tim Gallagher <span dir="ltr"><<a href="mailto:tim.gallagher@gatech.edu" target="_blank">tim.gallagher@gatech.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everybody,<br>
<br>
I'm plugging away at using the ExternalProject features to package up our code. Looking at the documentation for ExternalProject_Add, it says:<br>
<br>
...<br>
[GIT_SUBMODULES modules...] # Git submodules that shall be updated, all if empty<br>
...<br>
<br>
which is cool, but what do I do if I don't want any submodules updated at all? It seems my only choices are:<br>
<br>
1. Update them all (leaving GIT_SUBMODULES empty)<br>
2. Update some of them (set GIT_SUBMODULES to a list to update)<br>
<br>
but there's no 3rd option of not updating them at all.<br>
<br>
Any advice on how to keep it from updating any submodules?<br>
<br>
Thanks,<br>
<br>
Tim<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>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Nicholas Yue<br>Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5<br>Custom Dev - C++ porting, OSX, Linux, Windows<br><a href="http://au.linkedin.com/in/nicholasyue" target="_blank">http://au.linkedin.com/in/nicholasyue</a><br><a href="https://vimeo.com/channels/naiadtools" target="_blank">https://vimeo.com/channels/naiadtools</a><br></div></div>
</div>
</div><br></div><br>-- <br><br>Powered by www.kitware.com<br><br>Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ<br><br>Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br><br>CMake Support: http://cmake.org/cmake/help/support.html<br>CMake Consulting: http://cmake.org/cmake/help/consulting.html<br>CMake Training Courses: http://cmake.org/cmake/help/training.html<br><br>Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br><br>Follow this link to subscribe/unsubscribe:<br>http://public.kitware.com/mailman/listinfo/cmake</div><br></div></body></html>