summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-15 13:51:12 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-11-15 13:51:20 (GMT)
commit82e49021fec49d1b8243444eed44c6862e2d6ddc (patch)
tree6803875c45d52cefe181d4e32349bbd5cf129442 /Source
parente58936fd6d1878891b3d3e0d0b996aa7fd93faa2 (diff)
parent59573bf5b9afb2157c73b18dd189a0927dafee52 (diff)
downloadCMake-82e49021fec49d1b8243444eed44c6862e2d6ddc.zip
CMake-82e49021fec49d1b8243444eed44c6862e2d6ddc.tar.gz
CMake-82e49021fec49d1b8243444eed44c6862e2d6ddc.tar.bz2
Merge topic 'top-level-command-order'
59573bf5b9 project: Warn at top-level if `cmake_minimum_required` wasn't called 23f3dd9f7c RunCMake/project: Ignore exact line number in stderr checks Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7902
Diffstat (limited to 'Source')
-rw-r--r--Source/cmProjectCommand.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 249fe2d..4d1ccfe 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -34,6 +34,15 @@ bool cmProjectCommand(std::vector<std::string> const& args,
}
cmMakefile& mf = status.GetMakefile();
+ if (mf.IsRootMakefile() &&
+ !mf.GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION")) {
+ mf.IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ "cmake_minimum_required() should be called prior to this top-level "
+ "project() call. Please see the cmake-commands(7) manual for usage "
+ "documentation of both commands.");
+ }
+
if (!IncludeByVariable(status, "CMAKE_PROJECT_INCLUDE_BEFORE")) {
return false;
}