Definitely use a 'subdirs' template.  The Qt Creator team have
recommended 'Sessions' in the past but there is a big problem with
sessions/user.pro files - they cannot be added to version control (as
they contain user-specific paths, etc.)  This issue is a big deal when
working in a team - I want other members of my team to be able to
check out a project and have all the dependencies, etc. working
without having to tweak settings on the Qt Creator Project page.  The
subdirs template handles dependencies and it also allows command-line
qmake/make builds.

There .pro format is pretty powerful but the documentation isn't
brilliant and lacks examples of the more complicated stuff.  However,
with some tweaks to your project files you can do things like:

* Run unit tests after the unit test project has been linked (very
useful indeed.)
* Perform a 'pre build' step - generating a header containing a
version number for example.

I can post examples of this if desired.

2009/8/10 Murphy, Sean M. <[email protected]>:
> I posted this on Qt-Interest, but didn't get any responses, so I thought
> I'd try over here:
>
> I'm switching a bunch of Qt apps I've written over from Visual Studio,
> to Qt Creator and I'm a little stumped on how to handle a Qt shared
> library with each Qt app with respect to how Qt Creator handles project
> files.
>
> So say I have the following setup:
>  myLib - library of common classes used by all apps
>  appFoo - one application based on myLib
>  appBar - a second application based on myLib
>
> Originally I'd have two solutions, appFoo.sln and appBar.sln, each
> containing two Visual Studio .vcproj files, one project for the
> application (i.e. appFoo.vcproj), and one for the shared library
> (myLib.vcproj).  Then, when building the solution it would check
> dependencies for both projects, building each as necessary.  More
> importantly, when debugging I could debug both appFoo and myLib.  This
> debugging feature is what I'm really trying to regain in Qt Creator - to
> build able to step into the code of both the application and the shared
> library.
>
> I have working .pro files for everything (i.e., myLib.pro, appFoo.pro,
> appBar.pro) and I can build everything separately, but if I open one of
> those individual .pro files, I don't see the application AND library
> files, just one or the other.
>
> Should I be creating a "solution" .pro file for each app, and use
> SUBDIRS?  Something like:
>
> appFooSolution.pro:
>  TEMPLATE = subdirs
>  SUBDIRS = appFoo myLib
>
> appBarSolution.pro:
>  TEMPLATE = subdirs
>  SUBDIRS = appBar myLib
>
> Sean
>
> _______________________________________________
> Qt-creator mailing list
> [email protected]
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>

_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-creator

Reply via email to