瀏覽代碼

Help: Clarify find_library() behavior for suffixed libraries

The name is used as-is only if it contains a recognized suffix.
Clarify this behavior and add links to the relevant variables.

Fixes: #18401
Nikita Nemkin 8 月之前
父節點
當前提交
4b7ed0ec79
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      Help/command/find_library.rst

+ 4 - 2
Help/command/find_library.rst

@@ -52,8 +52,10 @@ for it.  The ``NAMES_PER_DIR`` option tells this command to consider one
 directory at a time and search for all names in it.
 directory at a time and search for all names in it.
 
 
 Each library name given to the ``NAMES`` option is first considered
 Each library name given to the ``NAMES`` option is first considered
-as a library file name and then considered with platform-specific
-prefixes (e.g. ``lib``) and suffixes (e.g. ``.so``).  Therefore one
+as is, if it contains a library suffix, and then considered with
+platform-specific prefixes (e.g. ``lib``) and suffixes (e.g. ``.so``),
+as defined by the variables :variable:`CMAKE_FIND_LIBRARY_PREFIXES` and
+:variable:`CMAKE_FIND_LIBRARY_SUFFIXES`. Therefore one
 may specify library file names such as ``libfoo.a`` directly.
 may specify library file names such as ``libfoo.a`` directly.
 This can be used to locate static libraries on UNIX-like systems.
 This can be used to locate static libraries on UNIX-like systems.