Sunday, March 1, 2015

Where to find Qt Configure Flags

Introduction

It's Sunday afternoon and I'm about to re-setup a development virtual machine. In the creation of it I'm going to be building Qt5 from source on Linux. Building from source can be troublesome at times because it's hard to find good information about the configure "script". This small entry is about where to find information (from source code) about Qt's configure "script".

If I do a quick google search with "Qt configure documentation", the first good link I get is for Qt4:

http://qt-project.org/doc/qt-4.8/configure-options.html

Not bad. The link below it is for Qt 5.4:

http://doc.qt.io/qt-5/configure-options.html

In the tradition of ever obtrusive documentation, it's very wordy and hard to find what you are looking for. In my opinion the documentation style for Qt5 is inferior to Qt4 (opinions are subject to change).

This entry is all about the actual mechanism behind the configure "script". I am putting script in quotation marks because it's not actually a script- it's an executable. The first step after pulling Qt down from source is to run "configure" in the root directory. Obviously if using Visual Studio you must have run this from the VS Command Prompt.

QT/configure [.bat]

There are two scripts in two languages named "configure" in the root directory. The regular old configure script is a shell script that simply executes qtbase/configure. The configure.bat does the same in its own way executing qtbase/configure.bat.

QT/qtbase/configure.bat

This script begins the "bootstrapping configure". Essentially it runs a perl script called syncqt.pl and then tries to build the configure tool in QT/tools/configure. The configure executable tool takes the place of the QT/qtbase/configure. When I built Qt 5.3 it looks as if this tool was never built- looks as if this is a Windows only step.

QT/qtbase/configure

This is a shell script that does the actual setup for the build. When using Visual Studio, this won't be utilized. Instead the configure application listed above is used. The reason why it exists this way is probably due to batch files being rotten but I could be wrong.

Where are the build options for configure?

In conclusion, to find the base options for the configure step in Qt the developer could look in QT/qtbase/configure (which is the script used for Linux) OR look qt QT/qtbase/tools/configureapp.cpp in the method Configure::parseCmdLine().

 - Visual Studio     - SOURCE : $QTDIR/qtbase/tools/configure/configureapp.cpp
   - TYPE   : Binary Application
   - METHOD : Configure::parseCmdLine()
 - Linux (Other)
   - SOURCE : $QTDIR/qtbase/configure
   - TYPE   : Shell Script
   - METHOD : Line 828? Look for "parse command line arguments"

Using the source code the developer can get definitive information about the configure arguments that can be passed into building Qt.




No comments:

Post a Comment