Commit adbaadf0 authored by Joachim Wuttke's avatar Joachim Wuttke
Browse files

Help: Apply syntax highlighting to project commands

  * Replace most "::" by ".. code-block:: cmake"
  * Header sentence in imperative voice,
    detailed command description in present tense.
parent 2459b5e8
add_compile_definitions
-----------------------
Adds preprocessor definitions to the compilation of source files.
Add preprocessor definitions to the compilation of source files.
::
.. code-block:: cmake
add_compile_definitions(<definition> ...)
......
add_compile_options
-------------------
Adds options to the compilation of source files.
Add options to the compilation of source files.
::
.. code-block:: cmake
add_compile_options(<option> ...)
......
......@@ -8,7 +8,9 @@ There are two main signatures for ``add_custom_command``.
Generating Files
^^^^^^^^^^^^^^^^
The first signature is for adding a custom command to produce an output::
The first signature is for adding a custom command to produce an output:
.. code-block:: cmake
add_custom_command(OUTPUT output1 [output2 ...]
COMMAND command1 [ARGS] [args1...]
......@@ -200,7 +202,7 @@ before or after building the target. The command becomes part of the
target and will only execute when the target itself is built. If the
target is already built, the command will not execute.
::
.. code-block:: cmake
add_custom_command(TARGET <target>
PRE_BUILD | PRE_LINK | POST_BUILD
......
......@@ -3,7 +3,7 @@ add_custom_target
Add a target with no output so it will always be built.
::
.. code-block:: cmake
add_custom_target(Name [ALL] [command1 [args1...]]
[COMMAND command2 [args2...] ...]
......
add_definitions
---------------
Adds -D define flags to the compilation of source files.
Add -D define flags to the compilation of source files.
::
.. code-block:: cmake
add_definitions(-DFOO -DBAR ...)
......
......@@ -3,11 +3,11 @@ add_dependencies
Add a dependency between top-level targets.
::
.. code-block:: cmake
add_dependencies(<target> [<target-dependency>]...)
Make a top-level ``<target>`` depend on other top-level targets to
Makes a top-level ``<target>`` depend on other top-level targets to
ensure that they build before ``<target>`` does. A top-level target
is one created by one of the :command:`add_executable`,
:command:`add_library`, or :command:`add_custom_target` commands
......
......@@ -3,7 +3,7 @@ add_executable
Add an executable to the project using the specified source files.
::
.. code-block:: cmake
add_executable(<name> [WIN32] [MACOSX_BUNDLE]
[EXCLUDE_FROM_ALL]
......@@ -47,7 +47,7 @@ within IDE.
--------------------------------------------------------------------------
::
.. code-block:: cmake
add_executable(<name> IMPORTED [GLOBAL])
......@@ -67,7 +67,7 @@ properties for more information.
--------------------------------------------------------------------------
::
.. code-block:: cmake
add_executable(<name> ALIAS <target>)
......
......@@ -10,7 +10,7 @@ Add a library to the project using the specified source files.
Normal Libraries
^^^^^^^^^^^^^^^^
::
.. code-block:: cmake
add_library(<name> [STATIC | SHARED | MODULE]
[EXCLUDE_FROM_ALL]
......@@ -67,7 +67,7 @@ within IDE.
Imported Libraries
^^^^^^^^^^^^^^^^^^
::
.. code-block:: cmake
add_library(<name> <SHARED|STATIC|MODULE|OBJECT|UNKNOWN> IMPORTED
[GLOBAL])
......@@ -92,7 +92,7 @@ for more information.
Object Libraries
^^^^^^^^^^^^^^^^
::
.. code-block:: cmake
add_library(<name> OBJECT <src>...)
......@@ -121,7 +121,7 @@ consider adding at least one real source file to any target that references
Alias Libraries
^^^^^^^^^^^^^^^
::
.. code-block:: cmake
add_library(<name> ALIAS <target>)
......@@ -141,7 +141,7 @@ installed or exported.
Interface Libraries
^^^^^^^^^^^^^^^^^^^
::
.. code-block:: cmake
add_library(<name> INTERFACE [IMPORTED [GLOBAL]])
......
add_link_options
----------------
Adds options to the link of shared library, module and executable targets.
Add options to the link of shared library, module and executable targets.
::
.. code-block:: cmake
add_link_options(<option> ...)
......
......@@ -3,12 +3,11 @@ add_subdirectory
Add a subdirectory to the build.
::
.. code-block:: cmake
add_subdirectory(source_dir [binary_dir]
[EXCLUDE_FROM_ALL])
add_subdirectory(source_dir [binary_dir] [EXCLUDE_FROM_ALL])
Add a subdirectory to the build. The source_dir specifies the
Adds a subdirectory to the build. The source_dir specifies the
directory in which the source CMakeLists.txt and code files are
located. If it is a relative path it will be evaluated with respect
to the current directory (the typical usage), but it may also be an
......
......@@ -3,13 +3,13 @@ add_test
Add a test to the project to be run by :manual:`ctest(1)`.
::
.. code-block:: cmake
add_test(NAME <name> COMMAND <command> [<arg>...]
[CONFIGURATIONS <config>...]
[WORKING_DIRECTORY <dir>])
Add a test called ``<name>``. The test name may not contain spaces,
Adds a test called ``<name>``. The test name may not contain spaces,
quotes, or other characters special in CMake syntax. The options are:
``COMMAND``
......@@ -39,7 +39,9 @@ The ``COMMAND`` and ``WORKING_DIRECTORY`` options may use "generator
expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
Example usage::
Example usage:
.. code-block:: cmake
add_test(NAME mytest
COMMAND testDriver --config $<CONFIGURATION>
......@@ -57,7 +59,7 @@ file produced by target ``myexe``.
---------------------------------------------------------------------
::
.. code-block:: cmake
add_test(<name> <command> [<arg>...])
......
......@@ -3,7 +3,7 @@ aux_source_directory
Find all source files in a directory.
::
.. code-block:: cmake
aux_source_directory(<dir> <variable>)
......
......@@ -3,7 +3,7 @@ create_test_sourcelist
Create a test driver and source list for building test programs.
::
.. code-block:: cmake
create_test_sourcelist(sourceListName driverName
test1 test2 test3
......
......@@ -3,7 +3,7 @@ define_property
Define and document custom properties.
::
.. code-block:: cmake
define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |
TEST | VARIABLE | CACHED_VARIABLE>
......@@ -11,7 +11,7 @@ Define and document custom properties.
BRIEF_DOCS <brief-doc> [docs...]
FULL_DOCS <full-doc> [docs...])
Define one property in a scope for use with the :command:`set_property` and
Defines one property in a scope for use with the :command:`set_property` and
:command:`get_property` commands. This is primarily useful to associate
documentation with property names that may be retrieved with the
:command:`get_property` command. The first argument determines the kind of
......
......@@ -3,12 +3,12 @@ enable_language
Enable a language (CXX/C/Fortran/etc)
::
.. code-block:: cmake
enable_language(<lang> [OPTIONAL] )
This command enables support for the named language in CMake. This is
the same as the project command but does not create any of the extra
Enables support for the named language in CMake. This is
the same as the :command:`project` command but does not create any of the extra
variables that are created by the project command. Example languages
are ``CXX``, ``C``, ``CUDA``, ``Fortran``, and ``ASM``.
......
......@@ -3,7 +3,7 @@ enable_testing
Enable testing for current directory and below.
::
.. code-block:: cmake
enable_testing()
......
......@@ -3,11 +3,11 @@ export
Export targets from the build tree for use by outside projects.
::
.. code-block:: cmake
export(EXPORT <export-name> [NAMESPACE <namespace>] [FILE <filename>])
Create a file ``<filename>`` that may be included by outside projects to
Creates a file ``<filename>`` that may be included by outside projects to
import targets from the current project's build tree. This is useful
during cross-compiling to build utility executables that can run on
the host platform in one project and then import them into another
......@@ -25,7 +25,7 @@ export targets from an installation tree.
The properties set on the generated IMPORTED targets will have the
same values as the final values of the input TARGETS.
::
.. code-block:: cmake
export(TARGETS [target1 [target2 [...]]] [NAMESPACE <namespace>]
[APPEND] FILE <filename> [EXPORT_LINK_INTERFACE_LIBRARIES])
......@@ -49,7 +49,7 @@ unspecified.
transitive usage requirements of other targets that link to the
object libraries in their implementation.
::
.. code-block:: cmake
export(PACKAGE <PackageName>)
......@@ -65,7 +65,7 @@ wide installations, it is not desirable to write the user package
registry. If the :variable:`CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable
is enabled, the ``export(PACKAGE)`` command will do nothing.
::
.. code-block:: cmake
export(TARGETS [target1 [target2 [...]]] [ANDROID_MK <filename>])
......
......@@ -3,7 +3,7 @@ fltk_wrap_ui
Create FLTK user interfaces Wrappers.
::
.. code-block:: cmake
fltk_wrap_ui(resultingLibraryName source1
source2 ... sourceN )
......
......@@ -3,11 +3,11 @@ get_source_file_property
Get a property for a source file.
::
.. code-block:: cmake
get_source_file_property(VAR file property)
Get a property from a source file. The value of the property is
Gets a property from a source file. The value of the property is
stored in the variable ``VAR``. If the source property is not found, the
behavior depends on whether it has been defined to be an ``INHERITED`` property
or not (see :command:`define_property`). Non-inherited properties will set
......
......@@ -3,7 +3,7 @@ get_target_property
Get a property from a target.
::
.. code-block:: cmake
get_target_property(VAR target property)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment