Review Request 128012: Check for an existing out-of-source build dir

René J.V. Bertin rjvbertin at gmail.com
Wed May 25 20:22:04 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128012/
-----------------------------------------------------------

(Updated May 25, 2016, 10:22 p.m.)


Review request for KDevelop.


Changes
-------

This implements an additional idea inspired by Tomaz Canabrava's contribution on kdevelop-devel.

`KDevelop::proposedBuildFolder()` now begins by checking if a helper utility with the name `kdevelop-custom-build-dir` exists in the path. If it does, it uses QProcess to call that utility with the `sourceFolder` as its (for now) sole argument. When the helper terminates successfully and returns a non-empty string, this string is returned if it is indeed an existing directory.

This works for me with a helper like this:
```sh
#!/bin/sh

if [ -r $1/CMakeLists.txt ] ;then
     cd $1
     if [ -d ../build -a -r ../build/CMakeCache.txt ] ;then
          cd ../build
          echo `pwd`
          exit
     fi
fi
echo `pwd`
```

Tomaz should be able to write something barely more complicated to return `/path/to/builds/foo` for a source directory `/path/to/projects/foo`.

I've left in the original check for an existing o-o-s build dir but that's more out of personal convenience.


Repository: kdevplatform


Description
-------

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 `KDevelop::proposedBuildFolder()`.
This is comparable to proposing to put the build folder alongside an existing `src` directory (but has priority over that rule).


Diffs (updated)
-----

  project/helper.cpp 6df9f90 

Diff: https://git.reviewboard.kde.org/r/128012/diff/


Testing
-------

Builds and behaves as expected.


Thanks,

René J.V. Bertin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160525/cad0adc2/attachment-0001.html>


More information about the KDevelop-devel mailing list