<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/128012/">https://git.reviewboard.kde.org/r/128012/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On June 2nd, 2016, 10:26 p.m. BST, <b>Milian Wolff</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/128012/diff/3/?file=465463#file465463line221" style="color: black; font-weight: bold; text-decoration: underline;">project/helper.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

    </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">221</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">const</span> <span class="n">QString</span> <span class="n">customDirScript</span> <span class="o">=</span> <span class="n">QStandardPaths</span><span class="o">::</span><span class="n">findExecutable</span><span class="p">(</span><span class="s">"kdevelop-custom-build-dir"</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;">I feel really bad with this... Yes - it's powerful, but it's also overkill, no? Who would ever write such a script?</p></pre>
 </blockquote>



 <p>On June 2nd, 2016, 11:15 p.m. BST, <b>Kevin Funk</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <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;">I also think the custom script is overkill. We should just default to sane default paths.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">+1 for discarding this idea. Sorry, Rene.</p></pre>
 </blockquote>





 <p>On June 3rd, 2016, 1:07 p.m. BST, <b>Alex Richardson</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <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;">I would use this feature but I'm not sure running a custom script is the best solution (it is however quite easy to implement). No one would ever use it because it is very hard to discover. Maybe there should be an option in the settings menu.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I have the following structure for my projects: source dirs are in /data/sources/ and build is in /build/ (separate partition because I don't have enough space on my SSD). It would be quite nice if I wouldn't have to manually set the build directory for every new project that I open.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">If I had known that kdevelop replaces /src/ with /build/ (as I found out by reading this diff) I could have come up with a different hierachy that wouldn't require running a custom script.</p></pre>
 </blockquote>





 <p>On June 3rd, 2016, 1:23 p.m. BST, <b>Kevin Funk</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <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;">Yes, I don't think this is super discoverable as is (using an external script).</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I think what <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">could work</em> is a line edit in the settings where can specify the translation from source directory to build directory (via string having the project name as placeholder). E.g. it would be "/build/${projectname}" in your case, and would default to something along "${projectpath/\/src/\/build}" (undecided about the syntax, can't think of anything more appropriate right now than Bash's string replacement syntax).</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Anyway, I don't think it needs to be / or should be an external script (way to complex).</p></pre>
 </blockquote>





 <p>On June 3rd, 2016, 2:17 p.m. BST, <b>René J.V. Bertin</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <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;">Evidently I have done <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">nothing</em> at the moment to make this discoverable, and evidently a final implementation would have something to attract the user's attention to the fact that this feature exists. One easy way would be in the project settings, a place to (wait for it) select a script that returns the build directory for a given source directory, and optionally a few choices for where that script will be searched (on $PATH; relative to the source directory; at a specific location).</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I did think of a special syntax myself, but realised very quickly that if you really want to do that right you'd end up either using an existing script language, or you suppose users are fluent in <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">awk</code> or you pick a solution in which you basically type the whole script in a text field and then use some <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">sh</code> variant to execute it. The former solution is evidently quite complex to implement; let's not even talk about awk, and with the latter, well, you can just as well read the script from disk even if KDevelop already has an external scripts implementation.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The problem with a simple translation is that it will typically not be sufficient at the level of the method we're patching. For instance, you may not want to pick <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">../build</code> if that directory exists but doesn't hold a CMakeCache and/or Makefile. That's a choice you cannot make at this level, but that a script <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">could</em> make, possibly on the basis of additional criteria that are purely local.
I see it this way: a script <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">can</em> be complex, but doesn't have to be. Generic logic that works well for everyone is going to be complex too, and probably (too) brittle. At the very least each project importer that calls this function would have to provide a function that checks the result of the user-supplied transformation to determine whether it can be an acceptable choice.</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;">QtCreator has a default build directory setting which can use lots of variables including <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">{JS:....} Evaluate simple JavaScript statements. The statements may not contain '{' nor '}' characters.</code> Maybe we should use a similar approach?</p></pre>
<br />




<p>- Alex</p>


<br />
<p>On May 25th, 2016, 9:24 p.m. BST, René J.V. Bertin 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 KDevelop.</div>
<div>By René J.V. Bertin.</div>


<p style="color: grey;"><i>Updated May 25, 2016, 9:24 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdevplatform
</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;">When importing a new project, check if it already has a pre-existing out-of-source build directory, and propose that as the build directory in <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">KDevelop::proposedBuildFolder()</code>.
This is comparable to proposing to put the build folder alongside an existing <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">src</code> directory (but has priority over that rule).</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;">Builds and behaves as expected.</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>project/helper.cpp <span style="color: grey">(6df9f90)</span></li>

</ul>

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






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







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