Configuring qmake to put files inside proper folder
Hello!
For better organization, I'ld like to put all files generated by QtCreator in a build command inside a "build" folder in my projects' folder. I've learned how to do most of this part - by configuring the .pro file of a project with the lines
Code:
MOC_DIR = build/moc
OBJECTS_DIR = build/obj
UI_DIR = build/ui
RCC_DIR = build/
and this part runs OK. The problem is that no matter how I try, when I run qmake it still insists in creating a "debug" and a "release" folder in my projects' base folder instead of creating them inside the "build" folder. I tried to correct this by configuring the DESTDIR variable:
Code:
win32
{
debug: DESTDIR = build/debug
release: DESTDIR = build/release
}
and although this was enough to make QtCreator put the executables and related in the correct place, qmake still insists in creating a "debug" and "release" folder in my projects' base folder (now always empty). How do I change this? It's interesting that, when configuring the project at the time of creating, I wrote that I wanted de build and release directories to be inside a "build" folder, but still Qt Creator didn't obey me :(
So how do I stop qmake from creating this two unecessary folders in my projects' base directory?
Thanks,
Momergil
Re: Configuring qmake to put files inside proper folder
The easiest way to create a build folder is to run qmake from there.
I usually have build at the same level as the project folder itself, i.e. outside the version controlled source folder
Something like
Code:
projectfolder
build
install
source
and I would initialize the build like this
Code:
cd build
qmake ../source/project.pro PREFIX=../install
Cheers,
_
Re: Configuring qmake to put files inside proper folder
This means you use the Qt command prompt to compile the project? o.O
Re: Configuring qmake to put files inside proper folder
No, just to create initialize the build directory.
When configuring the project in QtCreator I point it to that build so it can use it as well.
Cheers,
_