summaryrefslogtreecommitdiffstats
path: root/Help/command/try_compile.rst
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2022-09-22 17:43:14 (GMT)
committerMatthew Woehlke <matthew.woehlke@kitware.com>2022-09-22 18:56:50 (GMT)
commit611d80179006ba6670273fcfcad46b0bb64a36c2 (patch)
tree1975420c55f72ce6e9beb22c80aeae18398ded6b /Help/command/try_compile.rst
parenta04eaf6742d98dd415ee939eae8c955c8afd1ce6 (diff)
downloadCMake-611d80179006ba6670273fcfcad46b0bb64a36c2.zip
CMake-611d80179006ba6670273fcfcad46b0bb64a36c2.tar.gz
CMake-611d80179006ba6670273fcfcad46b0bb64a36c2.tar.bz2
try_compile: Add SOURCE_FROM_FILE
Add ability to copy try_compile (and try_run) source files from arbitrary locations into the operation directory. This is included for the sake of completion and consolidation, although use cases which actually require this may be rare.
Diffstat (limited to 'Help/command/try_compile.rst')
-rw-r--r--Help/command/try_compile.rst13
1 files changed, 12 insertions, 1 deletions
diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst
index ed61a2f..4632cd9 100644
--- a/Help/command/try_compile.rst
+++ b/Help/command/try_compile.rst
@@ -58,7 +58,8 @@ Try Compiling Source Files
try_compile(<resultVar>
<SOURCES <srcfile...>] |
SOURCE_FROM_ARG <name> <content>] |
- SOURCE_FROM_VAR <name> <var>] >...
+ SOURCE_FROM_VAR <name> <var>] |
+ SOURCE_FROM_FILE <name> <path> >...
[CMAKE_FLAGS <flags>...]
[COMPILE_DEFINITIONS <defs>...]
[LINK_OPTIONS <options>...]
@@ -178,6 +179,16 @@ The options are:
``SOURCE_FROM_ARG`` may be specified multiple times.
+``SOURCE_FROM_FILE <name> <path>``
+ .. versionadded:: 3.25
+
+ Copy ``<path>`` to a file named ``<name>`` in the operation directory. This
+ can be used to consolidate files into the operation directory, which may be
+ useful if a source which already exists (i.e. as a stand-alone file in a
+ project's source repository) needs to refer to other file(s) created by
+ ``SOURCE_FROM_*``. (Otherwise, ``SOURCES`` is usually more convenient.) The
+ specified ``<name>`` is not allowed to contain path components.
+
``SOURCE_FROM_VAR <name> <content>``
.. versionadded:: 3.25