diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-12-02 20:30:59 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-12-02 20:30:59 (GMT) |
commit | 27110975c2fb8e579ab85cc2313d0e243fb81d37 (patch) | |
tree | 06b8d0c0fa1d0105c57188a4cca5b6142abc9925 /Source/cmMakefile.cxx | |
parent | 5d2f83dad56a5e393374630522259ea4ecb42c96 (diff) | |
download | CMake-27110975c2fb8e579ab85cc2313d0e243fb81d37.zip CMake-27110975c2fb8e579ab85cc2313d0e243fb81d37.tar.gz CMake-27110975c2fb8e579ab85cc2313d0e243fb81d37.tar.bz2 |
ENH: add PROJECT command if there is not one
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d180b84..dcb47f8 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -308,9 +308,26 @@ bool cmMakefile::ReadListFile(const char* filename, const char* external) { filenametoread= external; } - + // try to see if the list file is the top most + // list file for a project, and if it is, then it + // must have a project command. If there is not + // one, then cmake will provide one via the + // cmListFileCache class. + bool requireProjectCommand = false; + if(!m_Inheriting && !external + && m_cmCurrentDirectory == m_cmHomeDirectory) + { + if(cmSystemTools::LowerCase( + cmSystemTools::GetFilenameName(filename)) == "cmakelists.txt") + { + requireProjectCommand = true; + std::cerr << "Require project command " << filename << "\n"; + } + } + cmListFile* lf = - cmListFileCache::GetInstance()->GetFileCache(filenametoread); + cmListFileCache::GetInstance()->GetFileCache(filenametoread, + requireProjectCommand); if(!lf) { return false; |