Incomplete description of QT configure Parameters

Source: Internet
Author: User

 

You only need to add the-fast parameter. Other parameters depend on your own, such as you do not need qt3 support can add-no-qt3support, or do not need WebKit Plug-no-WebKit
Configuration Parameter options:

In the preceding example, "*" indicates the default parameter. + indicates that this function must be evaluated and can be accepted only after the evaluation is successful.

-Release ........... disable debugging. without a debugging library, your project can only be released and cannot be debugged (because there is no debugging library). If you have to compile the debug version, you will be prompted that xxxxxd cannot be found. DLL

*-Debug ............. only the debugging library is available and the library is not released. That is to say, you can only debug your project in the future. If you have to compile the debug version, you will be prompted that XXXXX cannot be found. DLL

+-Debug-and-release. There are two types of Libraries after compilation. It is best to Compile two types of Libraries

-Opensource ...... compile the Open Source version.

-Compile cial... compile the commercial version. You do not need to specify these two parameters. To start configure, You need to select a version.

-Developer-build... compile the developer options.

*-Shared ...... dynamic compilation.

-Static ...... static Link Library. It seems that some plug-ins cannot be statically compiled.

*-No-fast ...... configure generates makefiles for all projects and compiles

-Fast ...... only generate makefiles for the project under the library directory and subdirectory.

-No-exceptions... support for disabling exceptions

*-Exceptions ...... enable exception support.

-No-Accessibility .. disable support for Windows Active controls.

*-Accessibility... supports Windows Active controls.

-No-STL ...... No C ++ standard library support

*-STL .............. supports the standard library.

Blogger has a problem with Angle brackets .....

-No-SQL-... disable SQL entirely, by default none are turned on.

-QT-SQL-... enable a SQL In the QT library.

-Plugin-SQL-enable SQL as a plugin to be linked to at runtime.

Available values:

MySQL

Psql

OCI

ODBC

TDS

DB2

+ SQLite

Sqlite2

IBase

(Drivers marked with a' + 'have been detected as available on this system)

-System-SQLite... use SQLite from the operating system.

-No-qt3support... does not support qt3 Functions

-No-OpenGL ...... OpenGL function support is not provided.

-Platform... the operating system and compiler you are building on.

(Default % qmakespec %)

-Xplatform .. the operating system and compiler you are cross compiling.

See the README file for a list of supported operating systems and compilers.

-Qtnamespace wraps all QT library code in 'namespace name {...}

-D ...... add an explicit define to the Preprocessor.

-I... add an explicit include path.

-L... add an explicit library path.

-L... add an explicit library name, residing in a librarypath.

-Graphicssystem specify which graphicssystem shoshould be used.

Available values:

* Raster-software Rasterizer

OpenGL-Using OpenGL accelleration, experimental!

-Help,-h ,-? ... Display this information.

Third-party library

-QT-zlib ...... use zlib to bind to QT.

+-System-zlib ...... use the zlib of the Operating System

See http://www.gzip.org/zlib

-No-GIF ...... support plug-ins for reading non-compiled GIF files

+-QT-GIF ...... support plug-ins for compiling GIF files

See src/plugins/imageformats/GIF/qgifhandler. h

-No-libpng ...... do not compile PNG support plug-ins.

-QT-libpng ...... PNG compilation support plug-ins.

+-System-libpng... use the system libpng library

See http://www.libpng.org/pub/png

-No-libmng ...... do not compile MNG support plug-ins.

-QT-libmng ...... compile the MNG support plug-in.

+-System-libmng... use the system's MNG Library

See http://www.libmng.com

-No-LibTIFF ...... do not compile the tiff support plug-in.

-QT-LibTIFF ...... compile the tiff support plug-in.

+-System-LibTIFF... use the LibTIFF library of the system.

See http://www.libtiff.org

-No-libjpeg ...... support plug-in Libraries without compiling JPEG.

-QT-libjpeg ...... compile the JPEG support plug-in library.

+-System-libjpeg... use the system JPEG support library

See http://www.ijg.org

The following parameters are only valid for Qt for Windows

-No-DSP ...... do not generate VC ++. DSP document.

*-DSP ............... generate VC ++. DSP documentation, which requires a platform identifier "win32-msvc ". note that qt4 does not support vc6.0 at the beginning, so these two parameters are invalid.

-No-vcproj... do not generate VC ++. vcproj documentation

*-Vcproj ...... generate VC ++. vcproj documentation, the platform identifier "win32-msvc.net" is required.

-No-incredibuild-xge do not add incredibuild xge distribution commands to custom build steps.

+-Incredibuild-xge .. add incredibuild xge distribution commands to custom build steps. This will distribute MOC and UIC steps, and other custom buildsteps which are added to the incredibuild_xge variable.

(The incredibuild distribution commands are only added to Visual Studio projects)

-No-plugin-manifests plug-in is not embedded in manifests.

*-Plugin-manifests .. plug-in embedding manifests.

-No-qmake ...... do not compile qmake

*-Qmake ........ compile qmake. We do not recommend that you do not compile qmake.

-Dont-process... do not generate makefiles and project documents. This parameter has a higher priority than the-no-fast parameter.

*-Process ...... generate makefiles and project documents.

-No-rtti ...... do not compile the runtime type information.

*-Rtti ............. indicates the type of the compilation runtime.

// The following statements are supported.

-No-MMX ...... do not compile with use of MMX instructions

+-MMX .......... compile with use of MMX instructions

-No-3dnow ...... do not compile

With use of 3 dnow instructions

+-3 dnow ...... compile with use of 3 dnow instructions

-No-SSE ...... do not compile with use of SSE instructions

+-SSE ...... with use of SSE instructions

-No-sse2 ...... do not compile with use of sse2 instructions

+-Sse2 ...... compile with use of sse2 instructions

+-Direct3d ...... compile the direct3d support. Direct3d SDK not supported

-No-OpenSSL ...... do not compile in OpenSSL support

+-OpenSSL ...... compile in run-time OpenSSL support

-OpenSSL-linked... compile in linked OpenSSL support

-No-compute... do not compile in D-bus support

+-Compute ...... compile in D-bus support and load libdbus-1 dynamically

-Your-linked... compile in D-bus support and link to libdbus-1

-No-phonon... do not compile the phonon Module

+-Phonon ...... compile the phonon module. (If the standard C ++ compiler is used, the phonon module is automatically compiled)

-No-phonon-backend. do not compile the platform-specific phonon backend-PLU

Gin

*-Phonon-backend... compile in the platform-specific phonon backend-plugin

-No-WebKit ...... it takes a lot of time to compile WebKit without compiling the WebKit module.

+-WebKit ...... compile the WebKit module. (If the standard C ++ compiler is used, the WebKit module is automatically compiled)

-No-scripttools... do not build the qtscripttools module.

*-Scripttools... build the qtscripttools module.

-Arch ...... appearance style.

There are the following types:

* Windows

WindowsCE

Boundschecker

Generic

-No-style-angle brackets contain the above style.

It takes too much time to compile a QT program. It is often used in a hurry and the compilation process is slower. In fact, a few simple tricks can help you save Compilation Time. The following is an example:

The first trick is to determine which functions are unnecessary before compilation and simply crop the compilation tree.
For example, the most common ones, such as demos and examples, are of reference value, but they can be used to compile small projects separately, which saves a lot of time. After practice, the simplest way is to modify the configure file, which has a field specifying the compilation directory:
Qt_default_build_parts = "libs tools examples demos docs translations"
You can remove examples, demos, and docs from the list, but note that you cannot remove other items.
If you find that some minor projects need to be compiled later, you can use the general QT program compilation method, that is, use qmake under the QT installation directory bin to generate makefile, you can also compile and test the sample code without affecting your use.

The second step is to crop the QT module.
Qt began to adopt a modular form from version 4 and encapsulated independent functions in an independent library. Therefore, it is easy to remove unnecessary libraries, this also saves Compilation Time and hard disk space usage. The Configure configuration of QT provides some configuration module methods, such as supporting-no-SVG and-no-WebKit. You can remove this support by adding these options When configuring QT. There are also many small functions that can be configured through the configure parameter. For details, refer to the output of configure-help. When viewing the configure help, pay special attention to the content with the * number, that is, the default configure option of QT. Sometimes, the default option may not necessarily be liked.
By default, the QT desktop version will compile as many feature as possible, which has some advantages: users can use all QT functions, but the disadvantages are also obvious, that is, the compiled QT super large, especially the debug version, basically occupies 1 to 2 GB of space, so I personally feel that it is necessary to study the configure options. In addition, some plug-ins do not compile by default. For example, database plug-ins often need to be compiled on your own as needed, so pay attention to this.

Step 3: configure the embedded version.
The embedded version of QT itself supports feature cropping. We can make full use of this feature to minimize the size of the QT library. The specific method is to create your own qconfig-[myconfig]. h feature file, which defines which feature in QT you want to remove. Add the "-qconfig myconfig" option to configure, and QT will compile it based on the configuration file you provided to achieve the goal of cropping. This cropping method is only applicable to embedded versions. Here, myconfig can be replaced by any name you like.
Some examples of qconfig header files are provided in the QT code. By default, full config is used for compiling.
No feature is cropped. All pre-defined qconfig files of QT can be found under src/corelib/global/, including qconfig-minimal. h, qconfig-small.h, qconfig. medium. h, qconfig-large.h and qconfig-dist.h, that is, from the cropping amount from more to less are based on. If you want to add your own configuration file, you need to create a file like a qconfig-xxx.h under src/corelib/Global, this XXX is the qconfig parameter you want to pass in during configure. I tested the QT version used is 4.4.1, this version of the build system has a small problem, that is, if you specify the qconfig parameter does not actually correspond to the qconfig-xxx.h file, build will not stop, it will only give an inconspicuous prompt, and the compilation process will continue, which is rather confusing. In this case, the configuration used by QT compilation is basically the same as that used by fullconfig. In view of its confusing behavior, I personally think it is necessary to remind you that, when using custom qconfig, make sure that the configuration file is in the correct position and the qconfig parameter is correct.
Generally, we recommend that you compile a full version in the test phase on the desktop, and summarize the available Feature Based on your project's use of QT feature. Feature is closely related to each other. This problem is also difficult for many people. For specific dependencies, See src/corelib/global/qfeatures. h and src/corelib/global/qfeatures.txt (dependency Description document ). In addition, QT provides a visual configuration dependency tool called qconfig in the qtdir/tools/qconfig directory. The tool must be compiled based on the qt desktop version. For example, in my Linux system, you can use the following command to compile:
$ D qt-embedded-linux-commercial-4.4.1/tools/qconfig
$/Usr/local/trolltech/Qt-4.4.3/bin/qmake
$ Make
After the compilation is successful, run./qconfig. open qfeatures.txt. qconfig to read the file and generate a tree chart, which clearly shows the dependency between feature. As shown in, if you remove the lineedit feature, the ComboBox that uses the control will no longer be used. Using this tool to crop QT becomes concise and intuitive, making it much easier.

Select the feature you want to remove and click File> Save .. will pop up the page to save the file, the file name should be defined as the form of qconfig-xxx.h, so you can pass in the corresponding qconfig parameters in configure. You can also open an existing qconfig-xxx.h file by choosing File-> open and edit the configuration faster by modifying existing files.
According to the author's test, the uncropped qte4.4.1 is compiled as follows:
Libqtcore. So is 2.6 m
Libqtgui. So is 9.5 m
If small is used for compilation, it can be reduced:
Libqtcore. So is 2.0 m
Libqtgui. So is 5.7 m
The difference is obvious.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.