summaryrefslogtreecommitdiff
path: root/Help/command/add_executable.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Help/command/add_executable.rst')
-rw-r--r--Help/command/add_executable.rst22
1 files changed, 18 insertions, 4 deletions
diff --git a/Help/command/add_executable.rst b/Help/command/add_executable.rst
index 0a7d7e151..e073228de 100644
--- a/Help/command/add_executable.rst
+++ b/Help/command/add_executable.rst
@@ -1,8 +1,15 @@
add_executable
--------------
+.. only:: html
+
+ .. contents::
+
Add an executable to the project using the specified source files.
+Normal Executables
+^^^^^^^^^^^^^^^^^^
+
.. code-block:: cmake
add_executable(<name> [WIN32] [MACOSX_BUNDLE]
@@ -45,7 +52,8 @@ See also :prop_sf:`HEADER_FILE_ONLY` on what to do if some sources are
pre-processed, and you want to have the original sources reachable from
within IDE.
---------------------------------------------------------------------------
+Imported Executables
+^^^^^^^^^^^^^^^^^^^^
.. code-block:: cmake
@@ -65,7 +73,8 @@ whose names begin in ``IMPORTED_``. The most important such property is
the main executable file on disk. See documentation of the ``IMPORTED_*``
properties for more information.
---------------------------------------------------------------------------
+Alias Executables
+^^^^^^^^^^^^^^^^^
.. code-block:: cmake
@@ -74,8 +83,13 @@ properties for more information.
Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can
be used to refer to ``<target>`` in subsequent commands. The ``<name>``
does not appear in the generated buildsystem as a make target. The
-``<target>`` may not be a non-``GLOBAL``
-:ref:`Imported Target <Imported Targets>` or an ``ALIAS``.
+``<target>`` may not be an ``ALIAS``.
+
+An ``ALIAS`` to a non-``GLOBAL`` :ref:`Imported Target <Imported Targets>`
+has scope in the directory in which the alias is created and below.
+The :prop_tgt:`ALIAS_GLOBAL` target property can be used to check if the
+alias is global or not.
+
``ALIAS`` targets can be used as targets to read properties
from, executables for custom commands and custom targets. They can also be
tested for existence with the regular :command:`if(TARGET)` subcommand.