Help: Fix signature of add_library(<name> INTERFACE EXCLUDE_FROM_ALL)

This signature was added by commit 4391913133 (Add INTERFACE libraries
to generated buildsystem if they have SOURCES, 2020-07-20,
v3.19.0-rc1~346^2~1) with incorrect documentation.

Previously the documented signature as:

    add_library(<name> INTERFACE [<source>...] [EXCLUDE_FROM_ALL])

which is incorrect.  CMake would recognize `EXCLUDE_FROM_ALL` as a source
file and report an error that it doesn't exists.

The correct signature is:

    add_library(<name> INTERFACE [EXCLUDE_FROM_ALL] [<source>...])

which places `EXCLUDE_FROM_ALL` in the same position used by the
documentation of other signatures.

Fixes: #25463
This commit is contained in:
namniav
2023-12-04 04:25:25 +08:00
committed by Brad King
parent 714a946781
commit 7fc6d7247a

View File

@@ -144,7 +144,7 @@ itself and is not included as a target in the generated buildsystem.
.. code-block:: cmake
add_library(<name> INTERFACE [<source>...] [EXCLUDE_FROM_ALL])
add_library(<name> INTERFACE [EXCLUDE_FROM_ALL] [<source>...])
Source files may be listed directly in the ``add_library`` call or added
later by calls to :command:`target_sources` with the ``PRIVATE`` or