<div class="gmail_quote">On Thu, Apr 8, 2010 at 10:28 AM, Daniel Nelson <span dir="ltr"><<a href="mailto:torham@connect2.com">torham@connect2.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Wednesday 07 April 2010 10:37:54 pm Michael Wild wrote:<br>
> On 8. Apr, 2010, at 3:39 , Ryan Pavlik wrote:<br>
> > You might consider just setting the EXCLUDE_FROM_ALL property on specific<br>
> > targets, instead of an entire subdirectory.<br>
> ><br>
> > Ryan<br>
> ><br>
> > On Wed, Apr 7, 2010 at 8:33 PM, Daniel Nelson <<a href="mailto:torham@connect2.com">torham@connect2.com</a>> wrote:<br>
> >> If I use add_subdirectory with the EXCLUDE_FROM_ALL option, then any<br>
> >> files whose install commands are in that directory are not installed as<br>
> >> part of 'make install'. Is this on purpose, and if so is there a way I<br>
> >> can install these files?<br>
> >> --<br>
> >> Daniel<br>
><br>
> Also there is the OPTIONAL argument to the INSTALL command which might be<br>
> of help here.<br>
><br>
><br>
> Michael<br>
><br>
<br>
</div>This is probably a pretty good workaround, but it's not ideal because I have<br>
several projects that add this directory, and I only want it to be excluded<br>
for some of them. So I'll end up needing to use a variable in the parent<br>
directory to control the EXCLUDE_FROM_ALL property. Then I need to use the<br>
OPTIONAL argument to prevent errors if I haven't built the directory, which<br>
means I won't be notified if a file is missing.<br>
<br>
What I'd really like to be able to do, is add new targets, and then manually<br>
set them to depend on whichever install commands I want. Then I could just<br>
run: make install/my_exclude_from_all_project. But it seems that the install<br>
commands are outside of the target system.<br>
<br></blockquote><div><br>Why not use the COMPONENT feature of the various install command signatures to separate your installables into components...?<br><br>Then you can run:<br> cd binary_dir<br> cmake -D COMPONENT=MyComponent -P cmake_install.cmake<br>
and that will run just the install rules associated with the COMPONENT MyComponent...<br><br>You could even add a custom target named "install_my_component" to do this via "make install_my_component" if you like...<br>
<br>HTH,<br>David<br><br></div></div>