Building multiple binaries in one qt project
-
wrote on 22 Mar 2012, 03:01 last edited by
I need to build multiple binaries(executable file .exe) from multiple source files(.cpp with main() inside) in one single qt project. I was using Qt creator to create qt project file. There is seems no options while creating new project.
How to build multiple binaries in one qt project? -
wrote on 22 Mar 2012, 03:53 last edited by
You have to create separate projects one for each .exe you need. And than you can combine them into one "subdirs project":http://qt-project.org/doc/qt-4.8/qmake-project-files.html#project-templates .
-
wrote on 22 Mar 2012, 09:33 last edited by
Indeed, using a subdirs project is the only way you can do this with qmake. Note that that may be different with cmake and qbs (a qt new build system that is in the experimental phase now).
-
wrote on 23 Mar 2012, 02:32 last edited by
Use subdirs template. You can create a dir for each program. Here is an example how to use multipule pro in 1 dir.
@TEMPLATE = subdirs
SUBDIRS = app1 app2app1.file = src/app_1.pro
app2.file = src/app_2.pro@
1/4