try_compile: Rename SOURCE_FROM_ARG -> SOURCE_FROM_CONTENT

Change the SOURCE_FROM_ARG keyword to try_compile to SOURCE_FROM_CONTENT
(which we can do because it was recently added and hasn't been in a
release yet). The new name should be clearer as to what it does, and
also more consistent with the CONTENT arguments to some other commands.

Also, fix a typo in an error message.
This commit is contained in:
Matthew Woehlke
2022-09-30 14:50:25 -04:00
parent cadcb6a5f0
commit 0f28653ba9
11 changed files with 37 additions and 35 deletions

View File

@@ -59,10 +59,10 @@ Try Compiling Source Files
.. code-block:: cmake
try_compile(<resultVar>
<SOURCES <srcfile...>] |
SOURCE_FROM_ARG <name> <content>] |
SOURCE_FROM_VAR <name> <var>] |
SOURCE_FROM_FILE <name> <path> >...
<SOURCES <srcfile...>] |
SOURCE_FROM_CONTENT <name> <content>] |
SOURCE_FROM_VAR <name> <var>] |
SOURCE_FROM_FILE <name> <path> >...
[NO_CACHE]
[CMAKE_FLAGS <flags>...]
[COMPILE_DEFINITIONS <defs>...]
@@ -194,7 +194,7 @@ The options are:
``OUTPUT_VARIABLE <var>``
Store the output from the build process in the given variable.
``SOURCE_FROM_ARG <name> <content>``
``SOURCE_FROM_CONTENT <name> <content>``
.. versionadded:: 3.25
Write ``<content>`` to a file named ``<name>`` in the operation directory.
@@ -202,7 +202,7 @@ The options are:
the contents of the file are dynamically specified. The specified ``<name>``
is not allowed to contain path components.
``SOURCE_FROM_ARG`` may be specified multiple times.
``SOURCE_FROM_CONTENT`` may be specified multiple times.
``SOURCE_FROM_FILE <name> <path>``
.. versionadded:: 3.25
@@ -218,10 +218,11 @@ The options are:
.. versionadded:: 3.25
Write the contents of ``<var>`` to a file named ``<name>`` in the operation
directory. This is the same as ``SOURCE_FROM_ARG``, but takes the contents
from the specified CMake variable, rather than directly, which may be useful
when passing arguments through a function which wraps ``try_compile``. The
specified ``<name>`` is not allowed to contain path components.
directory. This is the same as ``SOURCE_FROM_CONTENT``, but takes the
contents from the specified CMake variable, rather than directly, which may
be useful when passing arguments through a function which wraps
``try_compile``. The specified ``<name>`` is not allowed to contain path
components.
``SOURCE_FROM_VAR`` may be specified multiple times.

View File

@@ -13,10 +13,10 @@ Try Compiling and Running Source Files
.. code-block:: cmake
try_run(<runResultVar> <compileResultVar>
<SOURCES <srcfile...>] |
SOURCE_FROM_ARG <name> <content>] |
SOURCE_FROM_VAR <name> <var>] |
SOURCE_FROM_FILE <name> <path> >...
<SOURCES <srcfile...>] |
SOURCE_FROM_CONTENT <name> <content>] |
SOURCE_FROM_VAR <name> <var>] |
SOURCE_FROM_FILE <name> <path> >...
[NO_CACHE]
[CMAKE_FLAGS <flags>...]
[COMPILE_DEFINITIONS <defs>...]