<div class="gmail_quote">On Mon, Dec 20, 2010 at 7:51 AM, Mike McQuaid <span dir="ltr"><<a href="mailto:mike@mikemcquaid.com">mike@mikemcquaid.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 20 December 2010 12:34, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
> On Sun, Dec 19, 2010 at 3:50 PM, Mike McQuaid <<a href="mailto:mike@mikemcquaid.com">mike@mikemcquaid.com</a>> wrote:<br>
</div><div class="im">> When you find yourself in the "must escape too much" situation in an<br>
> INSTALL(CODE scenario.... you should switch to writing out a script that you<br>
> then include with an INSTALL(SCRIPT command. They are absolutely equivalent,<br>
> except with CODE you specify the code inline when it does not need<br>
> significant escaping, or if it's just a line or two. If it does need lots of<br>
> escaping or is longer than 1-3 lines, I would say it should be the SCRIPT<br>
> form anyway.<br>
><br>
> And honestly, I think that Eric's suggestion of using a<br>
> CPACK_PROJECT_CONFIG_FILE is the way to go here. If you have one, CPack will<br>
> include it before running your install rules. You can use any sentinel you<br>
> like within that file: it will only ever be included by CPack, so if you're<br>
> in its context, then you know you're being run by CPack.<br>
<br>
</div>That's a good suggestion and could do with being better documented<br>
(like most of CPack)!<br>
<br>
I still think the nicest solution would be to provide INSTALL(...<br>
PACKAGE) or something similar so you can do this all easily and<br>
visibly from your existing CMakeLists.txt files. That's my main<br>
reservation with using too many external script files, it's not<br>
obvious to someone reading the CMakeLists file what is actually<br>
happening.<br>
<br>
I'm happy to write a patch for this. Would this be accepted? Is this<br>
the wrong approach? If you guide me to creating an acceptable one, I'd<br>
be happy to write this.<br>
<br>
I created a bug about this so this is probably a good point of discussion:<br>
<a href="http://public.kitware.com/Bug/view.php?id=11142" target="_blank">http://public.kitware.com/Bug/view.php?id=11142</a><br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="h5">Mike McQuaid<br>
<a href="http://mikemcquaid.com" target="_blank">http://mikemcquaid.com</a><br>
</div></div></blockquote></div><br><br>I don't think an INSTALL(... PACKAGE construct is necessary. And, in fact, I think it might be harmful. (For one thing, INSTALL(PACKAGE sounds like you're installing "a package", not like you're installing "something you've built but only as part of an installer package.")<br>
<br>For the simple case, the binary package is nothing more than a copy of the "make install" tree. Adding stuff to the tree, but only for package installers, is unusual. But it is possible with existing mechanisms. (I still wouldn't recommend doing it.)<br>
<br>Why do you have differences in one install tree vs. another?<br><br>