summaryrefslogtreecommitdiffstats
path: root/Help/command/cmake_minimum_required.rst
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2021-05-15 05:26:01 (GMT)
committerCraig Scott <craig.scott@crascit.com>2021-05-15 05:26:01 (GMT)
commitb00a171b2b07d1644eba5c34a8679c6bb368cda7 (patch)
tree18bdaa496b01e91b527607c1b8850a49799838fb /Help/command/cmake_minimum_required.rst
parent639a6bd4c75740d339c8d28f5aba758a0fe11664 (diff)
downloadCMake-b00a171b2b07d1644eba5c34a8679c6bb368cda7.zip
CMake-b00a171b2b07d1644eba5c34a8679c6bb368cda7.tar.gz
CMake-b00a171b2b07d1644eba5c34a8679c6bb368cda7.tar.bz2
Help: Clarify calling cmake_minimum_required() inside a function
Fixes: #21519
Diffstat (limited to 'Help/command/cmake_minimum_required.rst')
-rw-r--r--Help/command/cmake_minimum_required.rst9
1 files changed, 7 insertions, 2 deletions
diff --git a/Help/command/cmake_minimum_required.rst b/Help/command/cmake_minimum_required.rst
index 2cc3cfe..d159770 100644
--- a/Help/command/cmake_minimum_required.rst
+++ b/Help/command/cmake_minimum_required.rst
@@ -40,8 +40,13 @@ with an error instead of just a warning.
they may affect. See also policy :policy:`CMP0000`.
Calling ``cmake_minimum_required()`` inside a :command:`function`
- limits some effects to the function scope when invoked. Such calls
- should not be made with the intention of having global effects.
+ limits some effects to the function scope when invoked. For example,
+ the :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable won't be set
+ in the calling scope. Functions do not introduce their own policy
+ scope though, so policy settings of the caller *will* be affected
+ (see below). Due to this mix of things that do and do not affect the
+ calling scope, calling ``cmake_minimum_required()`` inside a function
+ is generally discouraged.
.. _`Policy Settings`: