How to set source directory in qmake?
-
wrote on 7 Apr 2019, 19:50 last edited by
I'm tryi8ng to clean up my project a bit and would like to move all the source files to be under a directory called src/ so they don't get mixed with any files the build process geenrates. Is there a way to tell qmake to look for my files there?
-
Hi,
Yes, put src/ in front of all concerned file paths in your .pro file.
Note that if you use an out of source build, you don't have to worry about that.
-
Hi,
Yes, put src/ in front of all concerned file paths in your .pro file.
Note that if you use an out of source build, you don't have to worry about that.
-
As the name suggests: a build that happens out of your application source tree.
-
@kitfox said in How to set source directory in qmake?:
@SGaist What's an out of source build?
Sometimes it's called "shadow build": Creator uses them by default.
-
wrote on 8 Apr 2019, 07:48 last edited by
Hi! You can add these commands to your
.pro
file:MOC_DIR = ./src/moc OBJECTS_DIR = ./src/objects RCC_DIR = ./src/resource
It will clean up your application build directory and store all the
moc, objects, resources
files in thesrc
directory.
1/6