Building the Application¶
pyqtdeploy-build uses the project file created by
pyqtdeploy to generate the target-specific source code, including
the qmake .pro files, needed to create the application. The
simplest invocation is:
pyqtdeploy-build pyqt-demo.pdy
The next step in the full build process would be to change to the build directory and run qmake. The final step is target-specific. For Linux, macOS and Windows targets it is only necessary to run make (or nmake in the case of Windows). For an Android target it is necessary to run make and Qt’s androiddeployqt utility. For an iOS target qmake generates an Xcode project file. Xcode is then used to perform the final build.
The demo’s build-demo.py script takes care of (almost) all of this process automatically.
The Command Line¶
The full set of command line options is:
-
-h,--help¶ This will display a summary of the command line options.
-
--build-dirDIR¶ DIRis the name of the directory where all the application source code will be placed. The default value isbuild-followed by a target-specific suffix.
-
--include-dirDIR¶ DIRis the name of the directory containing the target Python installation’sPython.hfile. It overrides any value specified in the project file.
-
--interpreterEXECUTABLE¶ EXECUTABLEis the host Python interpreter used to compile all of the Python modules used by the application. It overrides any value specified in the project file.
-
--no-clean¶ Normally the build directory is deleted and re-created before starting a new build. Specifying this option leaves any existing build directory as it is before starting a new build.
-
--optLEVEL¶ LEVELis the level of optimisation performed when freezing Python source files:0 - no optimisation is done
1 -
assertstatements are removed2 -
assertstatements and docstrings are removed.The default is
2.
-
--python-libraryLIB¶ LIBis the name of the target Python interpreter library. It overrides any value specified in the project file.
-
--resourcesNUMBER¶ NUMBERis the number of Qt.qrcresource files that are generated. On Windows, MSVC may not be able to cope with very large resource files and complains of a lack of heap space. If you run into this problem then try increasing the the number of resource files generated.
-
--source-dirDIR¶ DIRis the name of the directory containing the Python source code. It overrides any value specified in the project file.
-
--standard-library-dirDIR¶ DIRis the name of the directory containing the target Python interpreter’s standard library. It overrides any value specified in the project file.
-
--sysrootDIR¶ DIRis the name of the system image root directory. TheSYSROOTenvironment variable is set toDIRduring the build replacing any existing value. The default value issysroot-followed by a target-specific suffix, but this is not set if theSYSROOTenvironment variable already has a value.
-
--targetTARGET¶ TARGETis the target architecture. By default the host architecture is used. On Windows the default is determined by the target architecture of the currently configured compiler.
-
--quiet¶ This specifies that progress messages should be disabled.
-
--verbose¶ This specifies that additional progress messages should be enabled.
-
-V,--version¶ This specifies that the version number should be displayed on
stdout. The program will then terminate.
-
project¶ projectis the name of the project file created by pyqtdeploy.