INSTALL_PARALLEL.rst 1.2 KB

123456789101112131415161718192021222324252627
  1. INSTALL_PARALLEL
  2. ----------------
  3. .. versionadded:: 3.30
  4. Enables parallel installation option for a project. The install code for each
  5. subdirectory added with ``add_subdirectory`` can run independently.
  6. When using the :ref:`Ninja Generators`, enabling this property causes
  7. ``install/local`` targets have the console pool disabled, allowing them to run
  8. concurrently.
  9. This property also provides the target ``install/parallel``, which has an
  10. explicit dependency on the ``install/local`` target for each subdirectory.
  11. .. versionadded:: 3.31
  12. When this property is enabled, ``cmake --install`` can be given the ``-j <jobs>``
  13. or ``--parallel <jobs>`` option to specify a maximum number of jobs.
  14. The :envvar:`CMAKE_INSTALL_PARALLEL_LEVEL` environment variable specifies a
  15. default parallel level if this option is not provided.
  16. Calls to :command:`install(CODE)` or :command:`install(SCRIPT)` might depend
  17. on actions performed by an earlier :command:`install` command in a different
  18. directory such as files installed or variable settings. If the project has
  19. such order-dependent installation logic, parallel installation should
  20. not be enabled, in order to prevent possible race conditions.