diff options
author | Matthew Woehlke <matthew.woehlke@kitware.com> | 2022-09-14 20:35:50 (GMT) |
---|---|---|
committer | Matthew Woehlke <matthew.woehlke@kitware.com> | 2022-09-14 20:35:50 (GMT) |
commit | 56ae40cc59b74d7d4cf4c00cf35badec6aea2274 (patch) | |
tree | e0fb95e0d167a6a6060ef097315fc3596701f19a /Help/command | |
parent | c3e68020d61ae306261b4f953947483a960edf32 (diff) | |
download | CMake-56ae40cc59b74d7d4cf4c00cf35badec6aea2274.zip CMake-56ae40cc59b74d7d4cf4c00cf35badec6aea2274.tar.gz CMake-56ae40cc59b74d7d4cf4c00cf35badec6aea2274.tar.bz2 |
try_compile: Add PROJECT keyword-dispatched signature
Introduce a new signature for the project flavor of try_compile (and
try_run) which removes the `bindir` argument and adds a required PROJECT
tag. This is similar to the SOURCES flavor added by commit aa9220d3
(try_compile: Add keyword-dispatched signature, 2022-09-02).
Diffstat (limited to 'Help/command')
-rw-r--r-- | Help/command/try_compile.rst | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst index 710fd21..97ad481 100644 --- a/Help/command/try_compile.rst +++ b/Help/command/try_compile.rst @@ -14,10 +14,15 @@ Try Compiling Whole Projects .. code-block:: cmake - try_compile(<resultVar> <bindir> <srcdir> - <projectName> [<targetName>] [CMAKE_FLAGS <flags>...] + try_compile(<resultVar> PROJECT <projectName> + SOURCE_DIR <srcdir> + [BINARY_DIR <bindir>] + [TARGET <targetName>] + [CMAKE_FLAGS <flags>...] [OUTPUT_VARIABLE <var>]) +.. versionadded:: 3.25 + Try building a project. The success or failure of the ``try_compile``, i.e. ``TRUE`` or ``FALSE`` respectively, is returned in ``<resultVar>``. @@ -34,6 +39,15 @@ below for the meaning of other options. Previously this was only done by the :ref:`source file <Try Compiling Source Files>` signature. +This command also supports an alternate signature +which was present in older versions of CMake: + +.. code-block:: cmake + + try_compile(<resultVar> <bindir> <srcdir> + <projectName> [<targetName>] [CMAKE_FLAGS <flags>...] + [OUTPUT_VARIABLE <var>]) + .. _`Try Compiling Source Files`: Try Compiling Source Files |