summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-07 15:16:12 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-07 15:17:26 (GMT)
commitfa077acba51393030586aa50f5eff9d6034c5c11 (patch)
tree3e4cee2462589525b03c447d399d868399f57d40 /Source
parentbe132dc6a6b5a979bdd115880911296e50c961a0 (diff)
parent1527defbfe4ae9cb8f74d5954c790c403727063b (diff)
downloadCMake-fa077acba51393030586aa50f5eff9d6034c5c11.zip
CMake-fa077acba51393030586aa50f5eff9d6034c5c11.tar.gz
CMake-fa077acba51393030586aa50f5eff9d6034c5c11.tar.bz2
Merge topic 'enforce-explicit-use-of-project'
1527defbfe cmMakefile: Enforce explicit use of project() command Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3245
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 3832427..6c390f7 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1599,6 +1599,16 @@ void cmMakefile::Configure()
}
// if no project command is found, add one
if (!hasProject) {
+ this->GetCMakeInstance()->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ "No project() command is present. The top-level CMakeLists.txt "
+ "file must contain a literal, direct call to the project() command. "
+ "Add a line of code such as\n"
+ " project(ProjectName)\n"
+ "near the top of the file, but after cmake_minimum_required().\n"
+ "CMake is pretending there is a \"project(Project)\" command on "
+ "the first line.",
+ this->Backtrace);
cmListFileFunction project;
project.Name.Lower = "project";
project.Arguments.emplace_back("Project", cmListFileArgument::Unquoted,