<div dir="ltr"><p dir="ltr" style="font-size:12.8px">Hi Alan,</p><p dir="ltr" style="font-size:12.8px">Thanks a lot! Yeah I was thinking about something along those lines, but i was wondering if there is a solution that does not involve modifying the submodules.</p></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 20, 2016 at 12:09 PM, Alan W. Irwin <span dir="ltr"><<a href="mailto:irwin@beluga.phys.uvic.ca" target="_blank">irwin@beluga.phys.uvic.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2016-07-20 11:02-0700 Tiago Macarios wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I have a project which uses git submodules to manage it's dependencies.<br>
Right now we want to add a installer to it, problem we have is that some of<br>
the dependencies have their own "install" directives. Is there a way to<br>
ignore a project install command?<br>
<br>
Long version case it is unclear:<br>
<br>
main project<br>
  submodule - has a install directive<br>
  myCode - actual code, links statically to submodule above<br>
<br>
I would like to only issue the install of myCode. is there a way to tell<br>
cmake or cpack to ignore "submodule" install directives?<br>
</blockquote>
<br></span>
Hi Tiago:<br>
<br>
You could brute force it by surrounding each install directive in<br>
submodule by<br>
<br>
if(INSTALL_SUBMODULE)<br>
....<br>
endif(INSTALL_SUBMODULE)<br>
<br>
Then add<br>
<br>
option(INSTALL_SUBMODULE, "Install submodule?" OFF)<br>
<br>
to your top-level CMakeLists.txt file.<br>
<br>
Then because of that OFF, by default users would not install<br>
submodule, but if users desired that install, they could specify the<br>
-DINSTALL_SUBMODULE=ON option on the cmake command line.  Or you could<br>
choose to default to ON.<br>
<br>
Note, I have characterized the above as brute force, but in fact the<br>
method is completely flexible, and most mature CMake projects use this<br>
kind of option-based method a lot.<br>
<br>
Alan<br>
__________________________<br>
Alan W. Irwin<br>
<br>
Astronomical research affiliation with Department of Physics and Astronomy,<br>
University of Victoria (<a href="http://astrowww.phys.uvic.ca" rel="noreferrer" target="_blank">astrowww.phys.uvic.ca</a>).<br>
<br>
Programming affiliations with the FreeEOS equation-of-state<br>
implementation for stellar interiors (<a href="http://freeeos.sf.net" rel="noreferrer" target="_blank">freeeos.sf.net</a>); the Time<br>
Ephemerides project (<a href="http://timeephem.sf.net" rel="noreferrer" target="_blank">timeephem.sf.net</a>); PLplot scientific plotting<br>
software package (<a href="http://plplot.sf.net" rel="noreferrer" target="_blank">plplot.sf.net</a>); the libLASi project<br>
(<a href="http://unifont.org/lasi" rel="noreferrer" target="_blank">unifont.org/lasi</a>); the Loads of Linux Links project (<a href="http://loll.sf.net" rel="noreferrer" target="_blank">loll.sf.net</a>);<br>
and the Linux Brochure Project (<a href="http://lbproject.sf.net" rel="noreferrer" target="_blank">lbproject.sf.net</a>).<br>
__________________________<br>
<br>
Linux-powered Science<br>
__________________________<br>
</blockquote></div><br></div>