From beeb551976122158e257646f6ecad6b07e61c675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AC=8A=E5=B0=91?= Date: Sun, 16 Jul 2023 22:00:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=BE=A9=E3=80=8Acmake-generator-expr?= =?UTF-8?q?essions(7)=E3=80=8B=E9=83=A8=E5=88=86=E5=95=8F=E9=A1=8C?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Help/index.rst | 2 +- Help/manual/cmake-generator-expressions.7.rst | 38 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Help/index.rst b/Help/index.rst index effd70837bf..305b79feebe 100644 --- a/Help/index.rst +++ b/Help/index.rst @@ -52,7 +52,7 @@ CMake被广泛用于C和C++,但它也可以用于构建其他语言的源代 cmake-developer(7):100% cmake-env-variables(7) cmake-file-api(7):4.5% - cmake-generator-expressions(7):100% + cmake-generator-expressions(7):17.2% cmake-generators(7) cmake-language(7):100% cmake-modules(7) diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index b92faf9822b..ad4b0d15d17 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -150,8 +150,8 @@ cmake-generator-expressions(7) .. note:: - 这个参考偏离了大多数CMake文档,因为它省略了尖括号\ ``<...>``\ 围绕占位符,\ - 如 ``condition``、\ ``string``、\ ``target``\ 等。这是为了防止那些占位符被错误地解释\ + 这个参考偏离了大多数CMake文档,因为它省略了尖括号\ ``<...>``\ 围绕占位符,\ 如\ + ``condition``、\ ``string``、\ ``target``\ 等。这是为了防止那些占位符被错误地解释\ 为生成器表达式。 .. _`Conditional Generator Expressions`: @@ -238,10 +238,11 @@ CMake支持各种生成器表达式进行比较。本节将介绍主要的和最 .. genex:: $ - 如果\ ``string1``\ 和\ ``string2``\ 相等,则为\ ``1``,否则为\ ``0``。比较是区分大小写的。\ - 要进行不区分大小写的比较,请与\ :ref:`字符串转换生成器表达式 `\ - 结合使用。例如,如果\ ``${foo}``\ 是\ ``BAR``、\ ``Bar``、\ ``bar``\ 等中的任意一个,\ - 则下面的计算结果为\ ``1``。 + 如果\ ``string1``\ 和\ ``string2``\ 相等,则为\ ``1``,否则为\ ``0``。比较是区分大\ + 小写的。要进行不区分大小写的比较,请与\ + :ref:`字符串转换生成器表达式 `\ 结合使\ + 用。例如,如果\ ``${foo}``\ 是\ ``BAR``、\ ``Bar``、\ ``bar``\ 等中的任意一个,则下\ + 面的计算结果为\ ``1``。 .. code-block:: cmake @@ -293,7 +294,8 @@ CMake支持各种生成器表达式进行比较。本节将介绍主要的和最 .. genex:: $ - ``...``\ 的内容转换为C标识符。转换遵循与\ :command:`string(MAKE_C_IDENTIFIER)`\ 相同的行为。 + ``...``\ 的内容转换为C标识符。转换遵循与\ :command:`string(MAKE_C_IDENTIFIER)`\ + 相同的行为。 列表表达式 ---------------- @@ -301,14 +303,10 @@ CMake支持各种生成器表达式进行比较。本节将介绍主要的和最 本节中的大多数表达式都与\ :command:`list`\ 命令密切相关,提供相同的功能,但采用生成器表达\ 式的形式。 -In each of the following list-related generator expressions, the ``list`` -must not contain any commas if that generator expression expects something to -be provided after the ``list``. For example, the expression -``$`` requires a ``value`` after the ``list``. -Since a comma is used to separate the ``list`` and the ``value``, the ``list`` -cannot itself contain a comma. This restriction does not apply to the -:command:`list` command, it is specific to the list-handling generator -expressions only. +在以下每个与列表相关的生成器表达式中,如果生成器表达式希望在\ ``list``\ 后提供某些内容,则该\ +``list``\ 不得包含任何逗号。例如,表达式\ ``$``\ 在\ ``list``\ +后面需要一个\ ``value``。由于使用逗号分隔\ ``list``\ 和\ ``value``,因此列表本身不能包\ +含逗号。此限制不适用于\ :command:`list`\ 命令,它仅特定于列表处理生成器表达式。 .. _GenEx List Comparisons: @@ -343,15 +341,15 @@ expressions only. .. versionadded:: 3.27 - 返回给定\ ``list``\ 的子列表。如果\ ``length``\ 为0,则返回空列表。如果\ ``length``\ 为-1或列表小于\ - ``begin + length``,则返回从\ ``begin``\ 开始的列表的其余项。 + 返回给定\ ``list``\ 的子列表。如果\ ``length``\ 为0,则返回空列表。如果\ ``length``\ + 为-1或列表小于\ ``begin + length``,则返回从\ ``begin``\ 开始的列表的其余项。 .. genex:: $ .. versionadded:: 3.27 - The index of the first item in ``list`` with the specified ``value``, - or -1 if ``value`` is not in the ``list``. + ``list``\ 中具有指定\ ``value``\ 的第一个项的索引,如果\ ``value``\ 不在\ ``list``\ + 中,则为-1。 .. _GenEx List Transformations: @@ -420,6 +418,8 @@ expressions only. 返回一个\ ``list``,其中给定\ ``index``\ 处的所有值都已删除。 +.. _GenEx LIST-REMOVE_DUPLICATES: + .. genex:: $ .. versionadded:: 3.27