Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 27

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qmake-manual.qdoc -->
  <title>Running qmake | qmake Manual</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qmake-manual.html">qmake Manual</a></td><td >Running qmake</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
  <link rel="prev" href="qmake-common-projects.html" />
  <link rel="next" href="qmake-platform-notes.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="qmake-common-projects.html">Building Common Project Types</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="qmake-platform-notes.html">Platform Notes</a>
</p><p/>
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#command-syntax">Command Syntax</a></li>
<li class="level1"><a href="#operating-modes">Operating Modes</a></li>
<li class="level1"><a href="#files">Files</a></li>
<li class="level1"><a href="#general-options">General Options</a></li>
<li class="level1"><a href="#makefile-mode-options">Makefile Mode Options</a></li>
<li class="level1"><a href="#project-mode-options">Project Mode Options</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Running qmake</h1>
<span class="subtitle"></span>
<!-- $$$qmake-running.html-description -->
<div class="descr"> <a name="details"></a>
<p>The behavior of qmake can be customized when it is run by specifying various options on the command line. These allow the build process to be fine-tuned, provide useful diagnostic information, and can be used to specify the target platform for your project.</p>
<a name="command-syntax"></a>
<h2 id="command-syntax">Command Syntax</h2>
<p>The syntax used to run qmake takes the following simple form:</p>
<pre class="cpp">

  qmake [mode] [options] files

</pre>
<a name="operating-modes"></a>
<h2 id="operating-modes">Operating Modes</h2>
<p>qmake supports two different modes of operation. In the default mode, qmake uses the information in a project file to generate a Makefile, but it is also possible to use qmake to generate project files. If you want to explicitly set the mode, you must specify it before all other options. The <code>mode</code> can be either of the following two values:</p>
<ul>
<li><code>-makefile</code> <br /> qmake output will be a Makefile.</li>
<li><code>-project</code> <br /> qmake output will be a project file. <br /><p><b>Note: </b>It is likely that the created file will need to be edited. For example, adding the <code>QT</code> variable to suit what modules are required for the project.</p></li>
</ul>
<p>You can use the <code>options</code> to specify both general and mode-specific settings. Options that only apply to the Makefile mode are described in the <a href="qmake-running.html#makefilemode">Makefile Mode Options</a> section, whereas options that influence the creation of project files are described in the <a href="qmake-running.html#projectmode">Project Mode Options</a> section.</p>
<a name="files"></a>
<h2 id="files">Files</h2>
<p>The <code>files</code> argument represents a list of one or more project files, separated by spaces.</p>
<a name="general-options"></a>
<h2 id="general-options">General Options</h2>
<p>A wide range of options can be specified on the command line to qmake in order to customize the build process, and to override default settings for your platform. The following basic options provide help on using qmake, specify where qmake writes the output file, and control the level of debugging information that will be written to the console:</p>
<ul>
<li><code>-help</code> <br /> qmake will go over these features and give some useful help.</li>
<li><code>-o file</code> <br /> qmake output will be directed to <code>file</code>. If this option is not specified, qmake will try to use a suitable file name for its output, depending on the mode it is running in.<br /> If '-' is specified, output is directed to stdout.</li>
<li><code>-d</code> <br /> qmake will output debugging information. Adding <code>-d</code> more than once increases verbosity.</li>
</ul>
<p>The template used for the project is usually specified by the <a href="qmake-variable-reference.html#template">TEMPLATE</a> variable in the project file. You can override or modify this by using the following options:</p>
<ul>
<li><code>-t tmpl</code> <br /> qmake will override any set <code>TEMPLATE</code> variables with <code>tmpl</code>, but only <i>after</i> the .pro file has been processed.</li>
<li><code>-tp prefix</code> <br /> qmake will add <code>prefix</code> to the <code>TEMPLATE</code> variable.</li>
</ul>
<p>The level of warning information can be fine-tuned to help you find problems in your project file:</p>
<ul>
<li><code>-Wall</code> <br /> qmake will report all known warnings.</li>
<li><code>-Wnone</code> <br /> No warning information will be generated by qmake.</li>
<li><code>-Wparser</code> <br /> qmake will only generate parser warnings. This will alert you to common pitfalls and potential problems in the parsing of your project files.</li>
<li><code>-Wlogic</code> <br /> qmake will warn of common pitfalls and potential problems in your project file. For example, qmake will report multiple occurrences of files in lists and missing files.</li>
</ul>
<a name="makefilemode"></a><a name="makefile-mode-options"></a>
<h2 id="makefile-mode-options">Makefile Mode Options</h2>
<pre class="cpp">

  qmake -makefile [options] files

</pre>
<p>In Makefile mode, qmake will generate a Makefile that is used to build the project. Additionally, the following options may be used in this mode to influence the way the project file is generated:</p>
<ul>
<li><code>-after</code> <br /> qmake will process assignments given on the command line after the specified files.</li>
<li><code>-nocache</code> <br /> qmake will ignore the <code>.qmake.cache</code> file.</li>
<li><code>-nodepend</code> <br /> qmake will not generate any dependency information.</li>
<li><code>-cache file</code> <br /> qmake will use <code>file</code> as the cache file, ignoring any other .qmake.cache files found.</li>
<li><code>-spec spec</code> <br /> qmake will use <code>spec</code> as a path to platform and compiler information, and ignore the value of <a href="qmake-environment-reference.html#qmakespec">QMAKESPEC</a>.</li>
</ul>
<p>You may also pass qmake assignments on the command line. They are processed before all of the files specified. For example, the following command generates a Makefile from test.pro:</p>
<pre class="cpp">

  qmake -makefile -o Makefile &quot;CONFIG+=test&quot; test.pro

</pre>
<p>However, some of the specified options can be omitted as they are default values:</p>
<pre class="cpp">

  qmake &quot;CONFIG+=test&quot; test.pro

</pre>
<p>If you are certain you want your variables processed after the files specified, then you may pass the <code>-after</code> option. When this is specified, all assignments on the command line after the <code>-after</code> option will be postponed until after the specified files are parsed.</p>
<a name="projectmode"></a><a name="project-mode-options"></a>
<h2 id="project-mode-options">Project Mode Options</h2>
<pre class="cpp">

  qmake -project [options] files

</pre>
<p>In project mode, qmake will generate a project file. Additionally, you may supply the following options in this mode:</p>
<ul>
<li><code>-r</code> <br /> qmake will look through supplied directories recursively.</li>
<li><code>-nopwd</code> <br /> qmake will not look in your current working directory for source code. It will only use the specified <code>files</code>.</li>
</ul>
<p>In this mode, the <code>files</code> argument can be a list of files or directories. If a directory is specified, it will be included in the <a href="qmake-variable-reference.html#dependpath">DEPENDPATH</a> variable, and relevant code from there will be included in the generated project file. If a file is given, it will be appended to the correct variable, depending on its extension. For example, UI files are added to <a href="qmake-variable-reference.html#forms">FORMS</a>, and C++ files are added to <a href="qmake-variable-reference.html#sources">SOURCES</a>.</p>
<p>You may also pass assignments on the command line in this mode. When doing so, these assignments will be placed last in the generated project file.</p>
</div>
<!-- @@@qmake-running.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="qmake-common-projects.html">Building Common Project Types</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="qmake-platform-notes.html">Platform Notes</a>
</p>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>