summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-07-23 19:45:53 (GMT)
committerBrad King <brad.king@kitware.com>2003-07-23 19:45:53 (GMT)
commit6f1a0440184e040c7ed0d21cd8e5f46b6177df3e (patch)
treebc5374b6c6e99bfaf5bcc21b7b3b6eb9a22e3826 /Source
parent48aedb2ba39621a75065a4b4bc5aca7ea695c65a (diff)
downloadCMake-6f1a0440184e040c7ed0d21cd8e5f46b6177df3e.zip
CMake-6f1a0440184e040c7ed0d21cd8e5f46b6177df3e.tar.gz
CMake-6f1a0440184e040c7ed0d21cd8e5f46b6177df3e.tar.bz2
ENH: Added backwards compatability.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSourceGroupCommand.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx
index 621b564..e863946 100644
--- a/Source/cmSourceGroupCommand.cxx
+++ b/Source/cmSourceGroupCommand.cxx
@@ -24,7 +24,7 @@ bool cmSourceGroupCommand::InitialPass(std::vector<std::string> const& args)
this->SetError("called with incorrect number of arguments");
return false;
}
-
+
// Get the source group with the given name.
cmSourceGroup* sg = m_Makefile->GetSourceGroup(args[0].c_str());
if(!sg)
@@ -33,6 +33,26 @@ bool cmSourceGroupCommand::InitialPass(std::vector<std::string> const& args)
sg = m_Makefile->GetSourceGroup(args[0].c_str());
}
+ // If only two arguments are given, the pre-1.8 version of the
+ // command is being invoked.
+ if(args.size() == 2 && args[1] != "FILES")
+ {
+ const char* versionValue =
+ m_Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
+ if(atof(versionValue) > 1.6)
+ {
+ this->SetError("no longer accepts a two-argument form. Use the "
+ "REGULAR_EXPRESSION argument form instead, or set "
+ "CMAKE_BACKWARDS_COMPATIBILITY to 1.6 or less.\n");
+ return false;
+ }
+ else
+ {
+ sg->SetGroupRegex(args[1].c_str());
+ return true;
+ }
+ }
+
// Process arguments.
bool doingFiles = false;
for(unsigned int i=1; i < args.size(); ++i)