<div class="gmail_quote">On Mon, Dec 20, 2010 at 7:51 AM, Mike McQuaid <span dir="ltr">&lt;<a href="mailto:mike@mikemcquaid.com">mike@mikemcquaid.com</a>&gt;</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 &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt; wrote:<br>
&gt; On Sun, Dec 19, 2010 at 3:50 PM, Mike McQuaid &lt;<a href="mailto:mike@mikemcquaid.com">mike@mikemcquaid.com</a>&gt; wrote:<br>
</div><div class="im">&gt; When you find yourself in the &quot;must escape too much&quot; situation in an<br>
&gt; INSTALL(CODE scenario.... you should switch to writing out a script that you<br>
&gt; then include with an INSTALL(SCRIPT command. They are absolutely equivalent,<br>
&gt; except with CODE you specify the code inline when it does not need<br>
&gt; significant escaping, or if it&#39;s just a line or two. If it does need lots of<br>
&gt; escaping or is longer than 1-3 lines, I would say it should be the SCRIPT<br>
&gt; form anyway.<br>
&gt;<br>
&gt; And honestly, I think that Eric&#39;s suggestion of using a<br>
&gt; CPACK_PROJECT_CONFIG_FILE is the way to go here. If you have one, CPack will<br>
&gt; include it before running your install rules. You can use any sentinel you<br>
&gt; like within that file: it will only ever be included by CPack, so if you&#39;re<br>
&gt; in its context, then you know you&#39;re being run by CPack.<br>
<br>
</div>That&#39;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&#39;s my main<br>
reservation with using too many external script files, it&#39;s not<br>
obvious to someone reading the CMakeLists file what is actually<br>
happening.<br>
<br>
I&#39;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&#39;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&#39;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&#39;re installing &quot;a package&quot;, not like you&#39;re installing &quot;something you&#39;ve built but only as part of an installer package.&quot;)<br>
<br>For the simple case, the binary package is nothing more than a copy of the &quot;make install&quot; tree. Adding stuff to the tree, but only for package installers, is unusual. But it is possible with existing mechanisms. (I still wouldn&#39;t recommend doing it.)<br>
<br>Why do you have differences in one install tree vs. another?<br><br>