I have a Qt project and I would like to output compilation files outside the source tree.
I currently have the following directory structure:
/ |_/build |_/mylib |_/include |_/src |_/resources
Depending on the configuration (debug/release), I will like to output the resulting files inside the build directory under build/debug or build/release directories.
How can I do that using a .pro file?
Also recently, newer versions of Qt have another little button on the right hand side of the "build directory" input field. It is has like a blue arrow on mine. Click it and you can view all the global build variables.
You can debug the generated qmake.exe in Qt creator. Click the menu Debug/Start Debugging/Start and Debug External Application, you'll be presented with a dialog, where you can specify the program to debug(c:\qtbuild\qtbase\bin\qmake.exe), its command line arguments(c:\Qt5. 12.1\5.12.
For my Qt project, I use this scheme in *.pro file:
HEADERS += src/dialogs.h SOURCES += src/main.cpp \ src/dialogs.cpp Release:DESTDIR = release Release:OBJECTS_DIR = release/.obj Release:MOC_DIR = release/.moc Release:RCC_DIR = release/.rcc Release:UI_DIR = release/.ui Debug:DESTDIR = debug Debug:OBJECTS_DIR = debug/.obj Debug:MOC_DIR = debug/.moc Debug:RCC_DIR = debug/.rcc Debug:UI_DIR = debug/.ui
It`s simple, but nice! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With