<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 10, 2015 at 9:22 AM, Nils Gladitz <span dir="ltr"><<a href="mailto:nilsgladitz@gmail.com" target="_blank">nilsgladitz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><span class="">
    On 11/09/2015 08:29 PM, Mark Stijnman wrote:<br>
    <blockquote type="cite">
      <div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><div>I think there should be a change in the CMake/CPack
                behavior here, regardless of whether the WiX generator
                will be extended to support this use case. For
                generators that support the same file to be installed
                from more than one component, such as the archive
                generators, it should check if the files are the same,
                and if not, report an error. Generators that don't
                support two files with the same destination at all
                should give an error when that occurs. <br>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br></span>
    The installation (staging) logic is out of scope for CPack itself
    (CPack and CMake are distinct entities; CPack can be used without
    CMake) and within CMake it probably won't work either...<br>
    <br>
    CMake allows the installation to replace pre-existing files and
    tries to do so efficiently by using timestamp comparisons and
    omitting the operation if the source is not in fact newer than the
    destination.<br>
    Even though this logic is not required when invoked through CPack
    (the staging area always starts out empty) it is still there.<br>
    So replacing an existing file (which may have distinct content from
    the source) is expected and legal and actually comparing content is
    probably considered too expensive either way.<span class=""><br>
    <br></span></div></blockquote><div>I understand, but this check for files with the same destination could (and IMHO should) still be done during the CPack generator stage.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><span class="">
    <br></span>
    In the WIX generator I suppose I could perhaps detect reused
    destination paths (in distinct components) and reuse references but
    I am not sure I like the idea of actually doing file content
    comparisons (though in this case it would be much more selective
    than doing it for the install step).<br></div></blockquote><div>That's what I've been thinking could be done, yes, but maybe it's not needed if dependencies would work (and definitely not needed if we simply not allow this situation at all, see below).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">Also this behavior would be specific to the WIX generator and would
    likely break semantically with every other generator.<br></div></blockquote><div><br></div><div>Not every generator: at least the archive generators already allow this. But this is why I'm advocating to rigorously define (and enforce) the semantics of this situation for all CPack generators. </div><div><br></div><div>However, I've just found that in <a href="https://cmake.org/Wiki/CMake:Component_Install_With_CPack">https://cmake.org/Wiki/CMake:Component_Install_With_CPack</a>, it says, under rules for components: "1. <span style="color:rgb(0,0,0);font-family:sans-serif;font-size:12.7px;line-height:19.05px">An object cannot belong to several COMPONENT</span>" - so I guess it's already defined, just not enforced, leading to unspecified behavior. I think either all generators should enforce this rule (at the risk of breaking projects that depend on unspecified behavior) or rule 1 should be relaxed (in which case I'd like the WiX generator to support the relaxed rule). I think I'll file this as a separate issue report (not specific to the WiX generator).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
    I wonder if I could perhaps instead do this automagically by merging
    hidden dependee components into their dependers.<br>
    <br>
    If you still think this is a good idea and something you would
    intend to use please open an issue.<span class=""><font color="#888888"><br>
    <br>
    Nils<br>
  </font></span></div>

</blockquote></div>I think WiX generator support for <span style="color:rgb(0,0,0);font-family:sans-serif;font-size:12.7px;line-height:19.05px">CPACK_COMPONENT_${COMPNAME}_DEPENDS</span> would be good to have, regardless of what happens with the "two files with same destination" issue. I'll file an issue report for this. Thanks,</div><div class="gmail_extra"><br></div><div class="gmail_extra">best regards Mark</div></div>