summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
Diffstat (limited to 'Help')
-rw-r--r--Help/command/try_compile.rst18
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