summaryrefslogtreecommitdiffstats
path: root/Help/command/file.rst
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-06-08 15:54:03 (GMT)
committerBrad King <brad.king@kitware.com>2017-06-09 14:38:43 (GMT)
commit82be694c7a1a878650563cd2c72b60f314d5dc85 (patch)
tree7ab8aa180d53af798fc19598874543ac2e98fd68 /Help/command/file.rst
parent69050f4d16ae649e074b5fd7cb3bae1811b403a8 (diff)
downloadCMake-82be694c7a1a878650563cd2c72b60f314d5dc85.zip
CMake-82be694c7a1a878650563cd2c72b60f314d5dc85.tar.gz
CMake-82be694c7a1a878650563cd2c72b60f314d5dc85.tar.bz2
file(GENERATE): Add policy CMP0070 to define relative path behavior
Previously `file(GENERATE)` did not define any behavior for relative paths given to the `OUTPUT` or `INPUT` arguments. Define behavior consistent with CMake conventions and add a policy to provide compatibility for projects that relied on the old accidental behavior. Fixes: #16786
Diffstat (limited to 'Help/command/file.rst')
-rw-r--r--Help/command/file.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Help/command/file.rst b/Help/command/file.rst
index b2e4eea..7afb715 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -291,6 +291,8 @@ from the input content to produce the output content. The options are:
``INPUT <input-file>``
Use the content from a given file as input.
+ A relative path is treated with respect to the value of
+ :variable:`CMAKE_CURRENT_SOURCE_DIR`. See policy :policy:`CMP0070`.
``OUTPUT <output-file>``
Specify the output file name to generate. Use generator expressions
@@ -298,6 +300,9 @@ from the input content to produce the output content. The options are:
name. Multiple configurations may generate the same output file only
if the generated content is identical. Otherwise, the ``<output-file>``
must evaluate to an unique name for each configuration.
+ A relative path (after evaluating generator expressions) is treated
+ with respect to the value of :variable:`CMAKE_CURRENT_BINARY_DIR`.
+ See policy :policy:`CMP0070`.
Exactly one ``CONTENT`` or ``INPUT`` option must be given. A specific
``OUTPUT`` file may be named by at most one invocation of ``file(GENERATE)``.