diff options
author | Brad King <brad.king@kitware.com> | 2008-03-31 17:33:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-03-31 17:33:09 (GMT) |
commit | e3666a1de575c7a2c4ef757b3f6e9a63fdfa2b8e (patch) | |
tree | e521de165a8ed09b010cc148b82f8b972555ae30 /Source/cmListFileCache.cxx | |
parent | 3652a8e913eab6befcbdc74cbd985763ed27db33 (diff) | |
download | CMake-e3666a1de575c7a2c4ef757b3f6e9a63fdfa2b8e.zip CMake-e3666a1de575c7a2c4ef757b3f6e9a63fdfa2b8e.tar.gz CMake-e3666a1de575c7a2c4ef757b3f6e9a63fdfa2b8e.tar.bz2 |
ENH: Allow policy CMP0000 to be set explicitly
- Message for missing cmake_minimum_required is not issued
until the end of processing the top CMakeLists.txt file
- During processing a cmake_policy command may set behavior
- OLD behavior is to silently ignore the problem
- NEW behavior is to issue an error instead of a warning
Diffstat (limited to 'Source/cmListFileCache.cxx')
-rw-r--r-- | Source/cmListFileCache.cxx | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 27a4878..c7383ea 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -171,30 +171,12 @@ bool cmListFile::ParseFile(const char* filename, if (isProblem) { - cmOStringStream msg; - msg << "No cmake_minimum_required command is present. " - << "A line of code such as\n" - << " cmake_minimum_required(VERSION " - << cmVersion::GetMajorVersion() << "." - << cmVersion::GetMinorVersion() - << ")\n" - << "should be added at the top of the file. " - << "The version specified may be lower if you wish to " - << "support older CMake versions for this project. " - << "For more information run " - << "\"cmake --help-policy CMP0000\"."; - switch (mf->GetPolicyStatus(cmPolicies::CMP0000)) - { - case cmPolicies::WARN: - mf->IssueMessage(cmake::AUTHOR_WARNING, msg.str().c_str()); - case cmPolicies::OLD: - // Implicitly set the version for the user. - mf->SetPolicyVersion("2.4"); - break; - default: - mf->IssueMessage(cmake::FATAL_ERROR, msg.str().c_str()); - return false; - } + // Tell the top level cmMakefile to diagnose + // this violation of CMP0000. + mf->SetCheckCMP0000(true); + + // Implicitly set the version for the user. + mf->SetPolicyVersion("2.4"); } } } |