Shadow build directory relative to the project file?
Hi,
is there a way to set the directory of the shadow build setting to be relative to the project file itself?
I need it for accessing the same .pro from multiple platforms (XP and Ubuntu in my case). Obviously the directory where the .pro resides has completely different names under the two OS's and I would need to (remember to) change it each time I switch from one to the other.
So, the possibility to set the shadow build directory to something like $$PWD/../build would be VERY useful.
Thanks,
M.
Re: Shadow build directory relative to the project file?
cd to the directory where you want the build to take place and call qmake with the relative directory to the project file. You really don't have to do everything in Creator... And besides, you can adjust the build steps freely in Qt Creator so even there it should be possible to obtain.
Re: Shadow build directory relative to the project file?
Thanks for the reply.
I know it can be done manually, and that manually it is possible to do more, but this is precisely what I'm trying to avoid as much as possible.
The code-compile-debug cycle is already complex enough and there are already so many things to remember that, at least for the compile step, I preferjust to have to press a button (if this means spending 1 or 2 days for configuring what stands behind that button, it's still time well spent), without having to remember a number of paths, different for each project and for each platform, and a number of command line syntaxes...
Maybe I'm spoiled by almost two decades of VC6 - VisualStudio7-8-9 usage, maybe it is my aging brain, maybe it is simply a different perspective... who knows...
But thanks anyway,
M.
P.S.: I take your answer as a polite "No, it is not possible", isn't it? (Customizations of qmake/make steps in Qt Creator are shared by all platforms, so this is not viable for me).
Re: Shadow build directory relative to the project file?
Sure it's possible. Qt Creator is Open Source - feel free to change it. Adding support for using environment variables in the proper place or even a full-blown per-platform configuration should be pretty easy.
Re: Shadow build directory relative to the project file?
Quote:
Originally Posted by
wysota
Qt Creator is Open Source - feel free to change it. Adding support for using environment variables in the proper place or even a full-blown per-platform configuration should be pretty easy.
This is definitely a possibility, once I have finished my current projects and met a few deadlines and once I have got familiarized with the few code lines of its source code... ;)
Seriously, thanks for your reply: different perspective and attitudes are always an enrichment, particularly when they come from a far greater experience than I have.
M.
Re: Shadow build directory relative to the project file?
I had the same problem, and although 'Guru' wysota is - of course - right, I did find a *workable* solution for a newbie (like me).
You can edit the .pro file, and add the following lines:
OBJECTS_DIR=$$builddir
DESTDIR=$$builddir
I tested this with a lib build. This will make sure that the binaries will go into the ./release and ./debug directories respectively (if nothing else edited).
Another option is to set these variables conditionally in the .pro file:
win32: { DESTDIR = dir1 }
linux: { DESTDIR = dir1 }
...
Re: Shadow build directory relative to the project file?
Ok, but your solution has nothing to do with shadow build.
Re: Shadow build directory relative to the project file?
You are right - and it doesn't even work (the first 'solution' that is). I messed up my settings so that it seemed to work. Sorry about that...