"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Help/command/add_library.rst" between
cmake-3.13.4.tar.gz and cmake-3.14.0-rc1.tar.gz

About: CMake is a cross-platform build system designed to build, test and package software. Release candidate.

add_library.rst  (cmake-3.13.4):add_library.rst  (cmake-3.14.0-rc1)
skipping to change at line 13 skipping to change at line 13
.. only:: html .. only:: html
.. contents:: .. contents::
Add a library to the project using the specified source files. Add a library to the project using the specified source files.
Normal Libraries Normal Libraries
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
:: .. code-block:: cmake
add_library(<name> [STATIC | SHARED | MODULE] add_library(<name> [STATIC | SHARED | MODULE]
[EXCLUDE_FROM_ALL] [EXCLUDE_FROM_ALL]
[source1] [source2 ...]) [source1] [source2 ...])
Adds a library target called ``<name>`` to be built from the source files Adds a library target called ``<name>`` to be built from the source files
listed in the command invocation. (The source files can be omitted here listed in the command invocation. (The source files can be omitted here
if they are added later using :command:`target_sources`.) The ``<name>`` if they are added later using :command:`target_sources`.) The ``<name>``
corresponds to the logical target name and must be globally unique within corresponds to the logical target name and must be globally unique within
a project. The actual file name of the library built is constructed based a project. The actual file name of the library built is constructed based
skipping to change at line 70 skipping to change at line 70
manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties. manual for more on defining buildsystem properties.
See also :prop_sf:`HEADER_FILE_ONLY` on what to do if some sources are 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 pre-processed, and you want to have the original sources reachable from
within IDE. within IDE.
Imported Libraries Imported Libraries
^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
:: .. code-block:: cmake
add_library(<name> <SHARED|STATIC|MODULE|OBJECT|UNKNOWN> IMPORTED add_library(<name> <SHARED|STATIC|MODULE|OBJECT|UNKNOWN> IMPORTED
[GLOBAL]) [GLOBAL])
An :ref:`IMPORTED library target <Imported Targets>` references a library An :ref:`IMPORTED library target <Imported Targets>` references a library
file located outside the project. No rules are generated to build it, and file located outside the project. No rules are generated to build it, and
the :prop_tgt:`IMPORTED` target property is ``True``. The target name has the :prop_tgt:`IMPORTED` target property is ``True``. The target name has
scope in the directory in which it is created and below, but the ``GLOBAL`` scope in the directory in which it is created and below, but the ``GLOBAL``
option extends visibility. It may be referenced like any target built option extends visibility. It may be referenced like any target built
within the project. ``IMPORTED`` libraries are useful for convenient within the project. ``IMPORTED`` libraries are useful for convenient
skipping to change at line 95 skipping to change at line 95
variant :prop_tgt:`IMPORTED_LOCATION_<CONFIG>`) which specifies the variant :prop_tgt:`IMPORTED_LOCATION_<CONFIG>`) which specifies the
location of the main library file on disk. Or, for object libraries, location of the main library file on disk. Or, for object libraries,
:prop_tgt:`IMPORTED_OBJECTS` (and :prop_tgt:`IMPORTED_OBJECTS_<CONFIG>`) :prop_tgt:`IMPORTED_OBJECTS` (and :prop_tgt:`IMPORTED_OBJECTS_<CONFIG>`)
specifies the locations of object files on disk. specifies the locations of object files on disk.
See documentation of the ``IMPORTED_*`` and ``INTERFACE_*`` properties See documentation of the ``IMPORTED_*`` and ``INTERFACE_*`` properties
for more information. for more information.
Object Libraries Object Libraries
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
:: .. code-block:: cmake
add_library(<name> OBJECT <src>...) add_library(<name> OBJECT <src>...)
Creates an :ref:`Object Library <Object Libraries>`. An object library Creates an :ref:`Object Library <Object Libraries>`. An object library
compiles source files but does not archive or link their object files into a compiles source files but does not archive or link their object files into a
library. Instead other targets created by :command:`add_library` or library. Instead other targets created by :command:`add_library` or
:command:`add_executable` may reference the objects using an expression of the :command:`add_executable` may reference the objects using an expression of the
form ``$<TARGET_OBJECTS:objlib>`` as a source, where ``objlib`` is the form ``$<TARGET_OBJECTS:objlib>`` as a source, where ``objlib`` is the
object library name. For example: object library name. For example:
skipping to change at line 124 skipping to change at line 124
that would not affect linking of a normal library (e.g. ``.txt``). that would not affect linking of a normal library (e.g. ``.txt``).
They may contain custom commands generating such sources, but not They may contain custom commands generating such sources, but not
``PRE_BUILD``, ``PRE_LINK``, or ``POST_BUILD`` commands. Some native build ``PRE_BUILD``, ``PRE_LINK``, or ``POST_BUILD`` commands. Some native build
systems (such as Xcode) may not like targets that have only object files, so systems (such as Xcode) may not like targets that have only object files, so
consider adding at least one real source file to any target that references consider adding at least one real source file to any target that references
``$<TARGET_OBJECTS:objlib>``. ``$<TARGET_OBJECTS:objlib>``.
Alias Libraries Alias Libraries
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
:: .. code-block:: cmake
add_library(<name> ALIAS <target>) add_library(<name> ALIAS <target>)
Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can be Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can be
used to refer to ``<target>`` in subsequent commands. The ``<name>`` does used to refer to ``<target>`` in subsequent commands. The ``<name>`` does
not appear in the generated buildsystem as a make target. The ``<target>`` 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 may not be a non-``GLOBAL`` :ref:`Imported Target <Imported Targets>` or an
``ALIAS``. ``ALIAS``.
``ALIAS`` targets can be used as linkable targets and as targets to ``ALIAS`` targets can be used as linkable targets and as targets to
read properties from. They can also be tested for existence with the read properties from. They can also be tested for existence with the
regular :command:`if(TARGET)` subcommand. The ``<name>`` may not be used regular :command:`if(TARGET)` subcommand. The ``<name>`` may not be used
to modify properties of ``<target>``, that is, it may not be used as the to modify properties of ``<target>``, that is, it may not be used as the
operand of :command:`set_property`, :command:`set_target_properties`, operand of :command:`set_property`, :command:`set_target_properties`,
:command:`target_link_libraries` etc. An ``ALIAS`` target may not be :command:`target_link_libraries` etc. An ``ALIAS`` target may not be
installed or exported. installed or exported.
Interface Libraries Interface Libraries
^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
:: .. code-block:: cmake
add_library(<name> INTERFACE [IMPORTED [GLOBAL]]) add_library(<name> INTERFACE [IMPORTED [GLOBAL]])
Creates an :ref:`Interface Library <Interface Libraries>`. An ``INTERFACE`` Creates an :ref:`Interface Library <Interface Libraries>`. An ``INTERFACE``
library target does not directly create build output, though it may library target does not directly create build output, though it may
have properties set on it and it may be installed, exported and have properties set on it and it may be installed, exported and
imported. Typically the ``INTERFACE_*`` properties are populated on imported. Typically the ``INTERFACE_*`` properties are populated on
the interface target using the commands: the interface target using the commands:
* :command:`set_property`, * :command:`set_property`,
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)