[Qt-interest] How make Qt projects / Makefiles with no hard-coded paths?

J-P Nurmi jpnurmi at gmail.com
Mon Mar 29 22:50:21 CEST 2010


On Mon, Mar 29, 2010 at 11:37 PM, Ed Sutton <ESutton at fescorp.com> wrote:
> What are some best practices for building Qt projects that leave no hard-coded paths in the Makefile or Qt project files?
>
> My goals are:
>
>
>  1.  Retrieve project source from Subversion on any machine configured for development or building releases.
>  2.  Build a release by running make in the project source using an un-modified version of the Makefile retrieved from Subversion ( no hard-coded paths in Makefile )
>  3.  Be able to open and build an un-modified Qt project file retrieved from Subversion ( no hard-coded paths in the Qt project file )
>
> I have not used QTDIR, PATH or QMAKESPEC environment variables before.  Is this the best way?
>
> I do not mind requiring Qt to be installed to a specific path such as /opt/qtsdk-2010.02 or configured in a consistent manner.
>

What's wrong with fully cross-platform and tool chain independent .pro
files that are much more human-readable than makefiles anyway?

Just forget about storing makefiles to version control system, but
store the qmake project file and let people choose their preferred way
to build the project. Let it be for example MSVC on Windows or Xcode
on Mac, your makefiles might not be that usable. qmake on the other
hand can generate VS/Xcode project files for those who want them.

--
J-P Nurmi




More information about the Qt-interest-old mailing list