From 04c57542e78013d9b9992b8b660a4c55eef6fcc4 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 26 May 2025 02:55:17 +0200 Subject: [PATCH] DeployQt4: Sync documentation - Added note that this module is for Qt version 4 and newer version should be used. - Added intro code block showing how to include this module. - Used word "commands" instead of "functions". - Added descriptions to commands. - Used lowercase names of commands. --- Modules/DeployQt4.cmake | 98 +++++++++++++++++++++++++---------------- 1 file changed, 61 insertions(+), 37 deletions(-) diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake index c94be82361..ded2a6d912 100644 --- a/Modules/DeployQt4.cmake +++ b/Modules/DeployQt4.cmake @@ -5,13 +5,24 @@ DeployQt4 --------- -This module provides a collection of CMake utility functions useful for +.. note:: + + This module is for Qt version 4. New code should follow the + :manual:`cmake-qt(7)` instead of using this module. + +This module provides a collection of CMake utility commands useful for assembling and deploying standalone Qt4 executables. -Functions -^^^^^^^^^ +Load this module in a CMake project with: -This module defines the following functions: +.. code-block:: cmake + + include(DeployQt4) + +Commands +^^^^^^^^ + +This module provides the following commands: * :command:`write_qt4_conf` * :command:`resolve_qt4_paths` @@ -22,36 +33,42 @@ This module defines the following functions: .. command:: write_qt4_conf + Creates a Qt configuration file: + .. code-block:: cmake - write_qt4_conf( ) + write_qt4_conf( ) - Writes a ``qt.conf`` file with the ```` into the - ```` directory. + This command writes a ``qt.conf`` file with the ```` into + the ```` directory. .. command:: resolve_qt4_paths + Resolves relative paths to absolute: + .. code-block:: cmake - resolve_qt4_paths( []) + resolve_qt4_paths( []) - Loops through the ```` list and if any path doesn't exist, it - resolves them relative to the ```` (if supplied) or the - :variable:`CMAKE_INSTALL_PREFIX`. + This command loops through the ```` list and if any path doesn't + exist, it resolves them relative to the ```` (if supplied) + or the :variable:`CMAKE_INSTALL_PREFIX`. .. command:: fixup_qt4_executable + Fixes up a Qt4 executable: + .. code-block:: cmake fixup_qt4_executable( - [ ] + [ ] ) - Copies Qt plugins, writes a Qt configuration file (if needed) and fixes up a - Qt4 executable using the :module:`BundleUtilities` module so it is standalone - and can be drag-and-drop copied to another machine as long as all of the - system libraries are compatible. + This command copies Qt plugins, writes a Qt configuration file (if needed) + and fixes up a Qt4 executable using the :module:`BundleUtilities` module + so it is standalone and can be drag-and-drop copied to another machine as + long as all of the system libraries are compatible. ```` should point to the executable to be fixed-up. @@ -65,26 +82,28 @@ This module defines the following functions: ```` will be passed to the :module:`BundleUtilities` module and should contain directories to be searched to find library dependencies. - ```` allows a custom plugins directory to be used. + ```` allows a custom plugins directory to be used. - ```` will force a ``qt.conf`` file to be written even if not + ```` will force a ``qt.conf`` file to be written even if not needed. .. command:: install_qt4_plugin_path + Installs a resolved Qt4 plugin: + .. code-block:: cmake install_qt4_plugin_path( - - [ ] + + [ ] ) - Installs (or copies) a resolved ```` to the default plugins directory - (or ````) relative to ```` and stores the result in - a variable ````. + This command installs (or copies) a resolved ```` to the default + plugins directory (or ````) relative to ```` and + stores the result in a variable ````. If ```` is set to ``TRUE`` then the plugins will be copied rather than installed. This is to allow this module to be used at CMake time rather than @@ -94,36 +113,41 @@ This module defines the following functions: .. command:: install_qt4_plugin + Installs an unresolved Qt4 plugin: + .. code-block:: cmake install_qt4_plugin( - - [ ] + + [ ] ) - Installs (or copies) an unresolved ```` to the default plugins - directory (or ````) relative to ```` and stores the - result in a variable ````. For other arguments, - see also :command:`install_qt4_plugin_path`. + This command installs (or copies) an unresolved ```` to the default + plugins directory (or ````) relative to ```` and + stores the result in a variable ````. For other + arguments, see also :command:`install_qt4_plugin_path`. .. command:: install_qt4_executable + Installs Qt plugins, writes a Qt configuration file (if needed) and fixes + up a Qt4 executable: + .. code-block:: cmake install_qt4_executable( - [ ] + [ ] ) - Installs Qt plugins, writes a Qt configuration file (if needed) and fixes up a - Qt4 executable using the :module:`BundleUtilities` module so it is standalone - and can be drag-and-drop copied to another machine as long as all of the - system libraries are compatible. The executable will be fixed-up at install - time. ```` is the COMPONENT used for bundle fixup and plugin - installation. For other arguments, see also :command:`fixup_qt4_executable`. + This command uses the :module:`BundleUtilities` module so executable is + standalone and can be drag-and-drop copied to another machine as long as + all of the system libraries are compatible. The executable will be fixed-up + at install time. The ```` is the COMPONENT used for bundle fixup + and plugin installation. For other arguments, see also + :command:`fixup_qt4_executable`. #]=======================================================================] # The functions defined in this file depend on the fixup_bundle function @@ -416,7 +440,7 @@ function(install_qt4_executable executable) install(CODE "include(\"${CMAKE_CURRENT_FUNCTION_LIST_DIR}/DeployQt4.cmake\") set(BU_CHMOD_BUNDLE_ITEMS TRUE) -FIXUP_QT4_EXECUTABLE(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")" +fixup_qt4_executable(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")" ${component} ) endfunction()