Difference between revisions of "How to prevent Qt from compiling code examples"

From Qt Wiki
Jump to: navigation, search
 
(Cleanup)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''English''' [[How to prevent Qt from compiling code examples Bulgarian|Български]]
+
{{LangSwitch}}
 +
[[Category:HowTo]]
  
'''<span class="caps">NOTE</span>:''' This guide is for Qt 4. See [[Building Qt 5 from Git|Building_Qt_5_from_Git]] for instructions for Qt 5.
+
'''NOTE:''' This guide is for Qt 4. See [[Building_Qt_5_from_Git]] for instructions for Qt 5.
  
=Compile Qt Faster by Skipping Examples=
+
Compiling Qt is fairly straight-forward, but quite a lengthy process. To make it much quicker, an easy way is to prevent examples from being compiled.
 
 
Compiling Qt is fairly straight-forward, but quite a lengthy process.
 
 
 
To make it much quicker, an easy way is to prevent examples from being compiled.
 
  
 
One way of doing it is:
 
One way of doing it is:
 
 
* extract source sdk (or git clone it)
 
* extract source sdk (or git clone it)
* start configure with option “dont-process” (works only on windows, doesn’t seem to exist on Linux configure)<br />
+
* start configure with option "dont-process" (works only on windows, doesn't seem to exist on Linux configure)
* then launch explicitely newly created qmake to build only libs and tools<br />
+
<code>
* Compile generated makefile<br />
+
configure -openssl -qt-libjpeg -qt-gif -qt-zlib -webkit -phonon -no-plugin-manifests -plugin-sql-sqlite -opensource -debug-and-release -confirm-license -dont-process
 
+
</code>
Compilation time is improved by around 80% (approximately 100 minutes instead of 8 hours) and you end up with a perfectly usable Qt, in debug and release.
+
* then launch explicitely newly created qmake to build only libs and tools
 
+
<code>
On Linux configure and build can be accelerated by using all available cores. <br />
+
QTDIR%/qmake/qmake -r QT_BUILD_PARTS="libs tools"
 +
</code>
 +
* Compile generated makefile
 +
<code>
 +
nmake
 +
</code>
  
Note that compilation place is hardcoded inside qmake and used to find <span class="caps">QMAKESPEC</span>s. You can however change it later using <br />
+
Compilation time is improved by around 80 (approximately 100 minutes instead of 8 hours) and you end up with a perfectly usable Qt, in debug and release.
  
===Categories:===
+
On Linux configure and build can be accelerated by using all available cores.
 +
<code>
 +
export MAKEFLAGS=-j4
 +
configure -AllTheOptionsYouNeed
 +
make -j4
 +
</code>
  
* [[:Category:HowTo|HowTo]]
+
Note that compilation place is hardcoded inside qmake and used to find QMAKESPECs. You can however change it later using
 +
<code>
 +
qmake -query
 +
lists all available variable (mostly paths)
 +
qmake -set
 +
overrides previously hardcoded value

Latest revision as of 19:12, 28 June 2015

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

NOTE: This guide is for Qt 4. See Building_Qt_5_from_Git for instructions for Qt 5.

Compiling Qt is fairly straight-forward, but quite a lengthy process. To make it much quicker, an easy way is to prevent examples from being compiled.

One way of doing it is:

  • extract source sdk (or git clone it)
  • start configure with option "dont-process" (works only on windows, doesn't seem to exist on Linux configure)

configure -openssl -qt-libjpeg -qt-gif -qt-zlib -webkit -phonon -no-plugin-manifests -plugin-sql-sqlite -opensource -debug-and-release -confirm-license -dont-process

  • then launch explicitely newly created qmake to build only libs and tools

QTDIR%/qmake/qmake -r QT_BUILD_PARTS="libs tools"

  • Compile generated makefile

nmake

Compilation time is improved by around 80 (approximately 100 minutes instead of 8 hours) and you end up with a perfectly usable Qt, in debug and release.

On Linux configure and build can be accelerated by using all available cores. export MAKEFLAGS=-j4 configure -AllTheOptionsYouNeed make -j4

Note that compilation place is hardcoded inside qmake and used to find QMAKESPECs. You can however change it later using qmake -query lists all available variable (mostly paths) qmake -set overrides previously hardcoded value