project: Warn at top-level if cmake_minimum_required wasn't called

The top-level project() call will now issue an AUTHOR_WARNING if it
wasn't called after cmake_minimum_required().

Fixes: #24071
This commit is contained in:
friendlyanon
2022-11-11 16:15:30 +01:00
parent 23f3dd9f7c
commit 59573bf5b9
9 changed files with 30 additions and 2 deletions

View File

@@ -188,5 +188,6 @@ call exists, CMake will issue a warning and pretend there is a
Call the ``project()`` command near the top of the top-level
``CMakeLists.txt``, but *after* calling :command:`cmake_minimum_required`.
It is important to establish version and policy settings before invoking
other commands whose behavior they may affect.
other commands whose behavior they may affect and for this reason the
``project()`` command will issue a warning if this order is not kept.
See also policy :policy:`CMP0000`.