How to specify build directory in Qt Creator for shadow build without use of an absolute path?

Viewed 8569

Absolute paths are ridiculous. All we need - and all we are allowed, by the way - is to use a folder on the same level that the folder containing .pro file for shadow builds. There are bugs otherwise.

But you can't just specify ../mingw_debug for example. Yes, it is a relative path but relative to what? It turns out it is relative to current directory of Qt Creator, and this is completely meaningless.

%{sourceDir} is of no help either. %{sourceDir}/../mingw_debug dosen't work, at least on Windows. If there was a way to extract parent folder from sourceDir!

Does anybody know a way to solve the issue?

4 Answers

I'm using this code in *.pro file, it seems working fine.

CONFIG(debug, debug|release){
    DESTDIR=$$shadowed($$ROOT_PWD)/debug
}else{
    DESTDIR=$$shadowed($$ROOT_PWD)/release
}
Related