2013-10-15 19:17:36 +04:00
|
|
|
build_command
|
|
|
|
-------------
|
|
|
|
|
2013-11-14 01:01:20 +04:00
|
|
|
Get a command line to build the current project.
|
|
|
|
This is mainly intended for internal use by the :module:`CTest` module.
|
2013-10-15 19:17:36 +04:00
|
|
|
|
2013-11-14 01:01:20 +04:00
|
|
|
.. code-block:: cmake
|
2013-10-15 19:17:36 +04:00
|
|
|
|
|
|
|
build_command(<variable>
|
|
|
|
[CONFIGURATION <config>]
|
2013-11-14 01:01:20 +04:00
|
|
|
[TARGET <target>]
|
|
|
|
[PROJECT_NAME <projname>] # legacy, causes warning
|
|
|
|
)
|
2013-10-15 19:17:36 +04:00
|
|
|
|
2013-11-14 01:01:20 +04:00
|
|
|
Sets the given ``<variable>`` to a command-line string of the form::
|
2013-10-15 19:17:36 +04:00
|
|
|
|
2013-11-14 01:01:20 +04:00
|
|
|
<cmake> --build . [--config <config>] [--target <target>] [-- -i]
|
2013-10-15 19:17:36 +04:00
|
|
|
|
2013-11-14 01:01:20 +04:00
|
|
|
where ``<cmake>`` is the location of the :manual:`cmake(1)` command-line
|
|
|
|
tool, and ``<config>`` and ``<target>`` are the values provided to the
|
|
|
|
``CONFIGURATION`` and ``TARGET`` options, if any. The trailing ``-- -i``
|
2015-05-08 22:41:08 +03:00
|
|
|
option is added for :ref:`Makefile Generators` if policy :policy:`CMP0061`
|
|
|
|
is not set to ``NEW``.
|
2013-10-15 19:17:36 +04:00
|
|
|
|
2013-11-14 01:01:20 +04:00
|
|
|
When invoked, this ``cmake --build`` command line will launch the
|
|
|
|
underlying build system tool.
|
2013-10-15 19:17:36 +04:00
|
|
|
|
2013-11-14 01:01:20 +04:00
|
|
|
.. code-block:: cmake
|
2013-10-15 19:17:36 +04:00
|
|
|
|
|
|
|
build_command(<cachevariable> <makecommand>)
|
|
|
|
|
|
|
|
This second signature is deprecated, but still available for backwards
|
|
|
|
compatibility. Use the first signature instead.
|
|
|
|
|
2013-11-14 01:01:20 +04:00
|
|
|
It sets the given ``<cachevariable>`` to a command-line string as
|
2015-05-08 22:39:34 +03:00
|
|
|
above but without the ``--target`` option.
|
2013-11-14 01:01:20 +04:00
|
|
|
The ``<makecommand>`` is ignored but should be the full path to
|
|
|
|
msdev, devenv, nmake, make or one of the end user build tools
|
|
|
|
for legacy invocations.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
In CMake versions prior to 3.0 this command returned a command
|
|
|
|
line that directly invokes the native build tool for the current
|
|
|
|
generator. Their implementation of the ``PROJECT_NAME`` option
|
|
|
|
had no useful effects, so CMake now warns on use of the option.
|