diff options
author | Bartosz Kosiorek <bartosz.kosiorek@tomtom.com> | 2019-04-19 08:44:41 (GMT) |
---|---|---|
committer | Bartosz Kosiorek <bartosz.kosiorek@tomtom.com> | 2019-05-06 08:58:10 (GMT) |
commit | 1527defbfe4ae9cb8f74d5954c790c403727063b (patch) | |
tree | 8c69a42200ac071bb693935dc67e121dd6497dc6 /Source/cmMakefile.cxx | |
parent | 0f27e7d165c96f2c3ada1695df4f6cfaa44afe51 (diff) | |
download | CMake-1527defbfe4ae9cb8f74d5954c790c403727063b.zip CMake-1527defbfe4ae9cb8f74d5954c790c403727063b.tar.gz CMake-1527defbfe4ae9cb8f74d5954c790c403727063b.tar.bz2 |
cmMakefile: Enforce explicit use of project() command
Fixes: 17714
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 10 |
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, |