<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 />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On July 15th, 2014, 6:27 p.m. UTC, <b>Alex Merry</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/119300/diff/1/?file=290331#file290331line150" style="color: black; font-weight: bold; text-decoration: underline;">modules/ECMGenerateHeaders.cmake</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">150</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="nb">if</span><span class="p">(</span><span class="o">${</span><span class="nv">camelcase_headers_var</span><span class="o">}</span> <span class="s">STREQUAL</span> <span class="o">${</span><span class="nv">EGH_REQUIRED_HEADERS</span><span class="o">}</span><span class="p">)</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="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;">This test doesn't do what you think it does. Rather than comparing "${camelcase_headers_var}" with "${EGH_REQUIRED_HEADERS}", it will compare "${${camelcase_headers_var}}" with "${${EGH_REQUIRED_HEADERS}}". Unintuitive, I know.</p></pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; 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;">Entirely my mistake. All of frameworks compiled with no changes.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">Thank you <span style="color: #008000; font-weight: bold">for</span> taking the time to look at this.

I am now running with <span style="color: #666666">:</span>
cmake version <span style="color: #666666">3.0.20140712-</span>g2eadd1

One nameless Konsole tab over I was running with <span style="color: #666666">:</span>
cmake version <span style="color: #666666">2.8.12.2</span>

It might be worth noting that with the changes in this patch cmake <span style="color: #666666">2.8.12.2</span> was able to compile frameworks all the way to KHTML with no complaints. Clearly, I am a cmake novice, but <span style="color: #008000; font-weight: bold">if</span> this patch doesn<span style="border: 1px solid #FF0000">'</span>t <span style="color: #008000; font-weight: bold">break</span> the build with <span style="color: #666666">3.0</span> and it makes it possible to build it with <span style="color: #666666">2.8.12.2</span> it might make the overall build more robust.

Once again thanks <span style="color: #008000; font-weight: bold">for</span> your time.
</pre></div>
</p></pre>
<br />




<p>- Andreas</p>


<br />
<p>On July 15th, 2014, 1:38 p.m. UTC, Andreas Xavier wrote:</p>









<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>


<p style="color: grey;"><i>Updated July 15, 2014, 1:38 p.m.</i></p>









<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>