[Interest] Organizing multiple Qt and non-Qt "projects" that share code

Konstantin Tokarev annulen at yandex.ru
Mon Jul 30 11:09:50 CEST 2012



> Hello List!
> 
> What are some good ways to organize source code -- directory hierarchies,
> and such -- that will be used to build multiple Qt and non-Qt applications?
> 
> So far when I've written Qt applications, I've had one Qt "project" per
> application (where an application is a .exe file), and I've had all of my
> source code (including things like .ui files) live together in a single
> directory, and I build the application using qmake and a .pro file.
> 
> When code is shared between more than one project, I've simply
> copied the files (not counting well-organized third-party libraries).
> 
> My understanding is that I can't (or that at least it's not recommended to)
> use a single .pro file to build multiple targets (i.e., multiple applications).
> 
> Now I want to build a suite of applications that will share significant code.
> Some will be Qt applications, some non-Qt (portable c++ command-line)
> applications, and maybe a few odd and ends like scripts.
> 
> If Qt / qmake weren't involved, I would probably put all of the source code
> into a single directory, and use make with a makefile that had build
> rules for multiple targets.

You can try to replace qmake with premake [1]. It's a small build system without
external dependencies. Qt Creator plugin is in development [2].

[1] http://industriousone.com/topic/full-stack-qt-based-development-premake-available-download
[2] http://qt-project.org/wiki/PremakeProjectManager


 -- 
Regards,
Konstantin



More information about the Interest mailing list