mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Introduce `CMD_STRICT` to act as a parent for warnings about allowed but disrecommended usage. Introduce a warning that discourages use of non-target directives (which modify the build environment for the entire [sub]tree). Add notes to the official documentation recommending use of target-specific alternatives. This has been accepted wisdom for quite some time, but only some of the affected commands made any mention of this in the documentation.
23 lines
746 B
ReStructuredText
23 lines
746 B
ReStructuredText
link_libraries
|
|
--------------
|
|
|
|
Link libraries to all targets added later.
|
|
|
|
.. code-block:: cmake
|
|
|
|
link_libraries([item1 [item2 [...]]]
|
|
[[debug|optimized|general] <item>] ...)
|
|
|
|
Specify libraries or flags to use when linking any targets created later in
|
|
the current directory or below by commands such as :command:`add_executable`
|
|
or :command:`add_library`. See the :command:`target_link_libraries` command
|
|
for meaning of arguments.
|
|
|
|
.. |command_name| replace:: ``link_libraries``
|
|
.. |target_command_name| replace:: :command:`target_link_libraries`
|
|
.. note::
|
|
.. include:: include/NON_TARGET_NOTE_BODY.rst
|
|
|
|
Library dependencies are chained automatically, so directory-wide
|
|
specification of link libraries is rarely needed.
|