[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] skip install of subdirectory
From:       Tiago Macarios <tiagomacarios () gmail ! com>
Date:       2016-07-20 20:39:52
Message-ID: CAKLVFYHASYkGQMP0fCK_v6dj4G5nD4K8-5R6Z6WJd4BNxK-5Qg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Alan,

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.

On Wed, Jul 20, 2016 at 12:09 PM, Alan W. Irwin <irwin@beluga.phys.uvic.ca>
wrote:

> On 2016-07-20 11:02-0700 Tiago Macarios wrote:
>
> Hi,
>>
>> I have a project which uses git submodules to manage it's dependencies.
>> Right now we want to add a installer to it, problem we have is that some
>> of
>> the dependencies have their own "install" directives. Is there a way to
>> ignore a project install command?
>>
>> Long version case it is unclear:
>>
>> main project
>>   submodule - has a install directive
>>   myCode - actual code, links statically to submodule above
>>
>> I would like to only issue the install of myCode. is there a way to tell
>> cmake or cpack to ignore "submodule" install directives?
>>
>
> Hi Tiago:
>
> You could brute force it by surrounding each install directive in
> submodule by
>
> if(INSTALL_SUBMODULE)
> ....
> endif(INSTALL_SUBMODULE)
>
> Then add
>
> option(INSTALL_SUBMODULE, "Install submodule?" OFF)
>
> to your top-level CMakeLists.txt file.
>
> Then because of that OFF, by default users would not install
> submodule, but if users desired that install, they could specify the
> -DINSTALL_SUBMODULE=ON option on the cmake command line.  Or you could
> choose to default to ON.
>
> Note, I have characterized the above as brute force, but in fact the
> method is completely flexible, and most mature CMake projects use this
> kind of option-based method a lot.
>
> Alan
> __________________________
> Alan W. Irwin
>
> Astronomical research affiliation with Department of Physics and Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
>
> Programming affiliations with the FreeEOS equation-of-state
> implementation for stellar interiors (freeeos.sf.net); the Time
> Ephemerides project (timeephem.sf.net); PLplot scientific plotting
> software package (plplot.sf.net); the libLASi project
> (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
> and the Linux Brochure Project (lbproject.sf.net).
> __________________________
>
> Linux-powered Science
> __________________________
>

[Attachment #5 (text/html)]

<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">&lt;<a href="mailto:irwin@beluga.phys.uvic.ca" \
target="_blank">irwin@beluga.phys.uvic.ca</a>&gt;</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&#39;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 &quot;install&quot; 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 &quot;submodule&quot; 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, &quot;Install submodule?&quot; 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>



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic