summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-12 17:40:34 (GMT)
committerBrad King <brad.king@kitware.com>2014-06-12 17:42:01 (GMT)
commit50dca47106a17fe9a4a929243fd12f84d4f95e79 (patch)
tree581039b3e76b83ed673c8f0892a536564ef1e277
parent4054534cc63009652f2fa54f962b1b4fd318de4b (diff)
downloadCMake-50dca47106a17fe9a4a929243fd12f84d4f95e79.zip
CMake-50dca47106a17fe9a4a929243fd12f84d4f95e79.tar.gz
CMake-50dca47106a17fe9a4a929243fd12f84d4f95e79.tar.bz2
Help: Organize Binary Targets section of cmake-buildsystem.7
Add a subsection for Binary Executables just before Binary Library Types. Divide the library section into Normal Libraries and Object Libraries.
-rw-r--r--Help/manual/cmake-buildsystem.7.rst33
1 files changed, 26 insertions, 7 deletions
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index e4b58c0..a7402f7 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -19,8 +19,8 @@ and the rules for regeneration in response to change.
Binary Targets
==============
-Executables and libraries are defined using the :command:`add_library`
-and :command:`add_executable` commands. The resulting binary files have
+Executables and libraries are defined using the :command:`add_executable`
+and :command:`add_library` commands. The resulting binary files have
appropriate prefixes, suffixes and extensions for the platform targeted.
Dependencies between binary targets are expressed using the
:command:`target_link_libraries` command:
@@ -37,9 +37,28 @@ is defined as an executable formed by compiling and linking ``zipapp.cpp``.
When linking the ``zipapp`` executable, the ``archive`` static library is
linked in.
+Binary Executables
+------------------
+
+The :command:`add_executable` command defines an executable target:
+
+.. code-block:: cmake
+
+ add_executable(mytool mytool.cpp)
+
+Commands such as :command:`add_custom_command`, which generates rules to be
+run at build time can transparently use an :prop_tgt:`EXECUTABLE <TYPE>`
+target as a ``COMMAND`` executable. The buildsystem rules will ensure that
+the executable is built before attempting to run the command.
+
Binary Library Types
--------------------
+.. _`Normal Libraries`:
+
+Normal Libraries
+^^^^^^^^^^^^^^^^
+
By default, the :command:`add_library` command defines a static library,
unless a type is specified. A type may be specified when using the command:
@@ -66,6 +85,11 @@ It is a type which is loaded as a plugin using runtime techniques.
add_library(archive MODULE 7z.cpp)
+.. _`Object Libraries`:
+
+Object Libraries
+^^^^^^^^^^^^^^^^
+
The ``OBJECT`` library type is also not linked to. It defines a non-archival
collection of object files resulting from compiling the given source files.
The object files collection can be used as source inputs to other targets:
@@ -83,11 +107,6 @@ they may not be installed, exported, or used in the right hand side of
:command:`target_link_libraries`. They also may not be used as the ``TARGET``
in a use of the :command:`add_custom_command(TARGET)` command signature.
-Commands such as :command:`add_custom_command`, which generates rules to be
-run at build time can transparently use an :prop_tgt:`EXECUTABLE <TYPE>`
-target as a ``COMMAND`` executable. The buildsystem rules will ensure that
-the executable is built before attempting to run the command.
-
Build Specification and Usage Requirements
==========================================