<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/119300/">https://git.reviewboard.kde.org/r/119300/</a>
     </td>
    </tr>
   </table>
   <br />





<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KDE Frameworks, Alex Merry and Michael Pyne.</div>
<div>By Andreas Xavier.</div>










<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
extra-cmake-modules
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">First, this is my first attempt at building frameworks, so the problem is most likely on my end.  However, following the instructions at https://community.kde.org/Frameworks/Building/Details I found this problem.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Using the same variable name for camelCase var1 and REQUIRED_HEADERS var2 in the new ecm_generate_headers() syntax, when it is called more than once only exports the headers from the first invokation of ecm_generate_headers(), where var1 and var2 are defined as follows.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">ecm_generate_headers(var1<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
...<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
REQUIRED_HEADERS var2<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
)</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">It doesn't show up in existing builds because cmake doesn't delete old header files, so all accumulated headers remain in the build.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">There are some projects in kde-frameworks that use the same variable name for var1 and var2, for example kcoreaddons.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Steps to Replicate Using KCoreAddons as an example:</p>
<ol style="padding: 0;text-rendering: inherit;margin: 0 0 0 2em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Delete the existing header files for KCoreAddons and the existing build files.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
    rm -r $KF5/KcoreAddons<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
    rm -r <your kcoreaddons/build directory></li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Re-build kcoreaddons from a new build dir<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
    cmake -DCMAKE_INSTALL_PREFIX=$KF5 ..</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Check in $KF5/KcoreAddons and there should only be these headers:<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
    KAboutData kaboutdata.h kcoreaddons_export.h</li>
</ol>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Problem:<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
If the same variable name is used for both var1 and var2 they overwrite each other at the PARENT level and the result is that only one invocation of ecm_generate_headers sticks. </p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Solution:<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
I assume that the CMakeList writer is intentionally using the same variable name for var1 and var2 and wants to accumulate both the camelCase and the lowercase.h names on the same variable.  If the variable names are the same if accumulates both the camelCase list and the lowercase.h list on the single variable.    </p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">If my assumption is incorrect and var1 and var2 must be different to separate the camelCase and lowercase.h lists, then a new patch should be submitted to generate either a warning or an error message when var1 and var2 are the same name.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This review is linked with https://git.reviewboard.kde.org/r/119275/.  If this review is accepted then https://git.reviewboard.kde.org/r/119275/ is unecessary.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">make test<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
Compiled kcoreaddons, checked that all the headers were exported.  Then compiled kauth and checked that it found the exported headers.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>modules/ECMGenerateHeaders.cmake <span style="color: grey">(bac5086)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/119300/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>




  </div>
 </body>
</html>