summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-07-21 18:44:25 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-07-21 18:44:25 (GMT)
commit0152cc3a35393f4aa0cd285bef92425bd85b3fa5 (patch)
tree15c63139de1a5634f6dc11d3d8495513a325790a /Source
parent18c6f9e0c51cd66ba5abfe9f572184a18c17c2f3 (diff)
downloadCMake-0152cc3a35393f4aa0cd285bef92425bd85b3fa5.zip
CMake-0152cc3a35393f4aa0cd285bef92425bd85b3fa5.tar.gz
CMake-0152cc3a35393f4aa0cd285bef92425bd85b3fa5.tar.bz2
ENH: Use new deprecation mechanism
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSourceFilesCommand.cxx15
-rw-r--r--Source/cmSourceFilesCommand.h7
2 files changed, 16 insertions, 6 deletions
diff --git a/Source/cmSourceFilesCommand.cxx b/Source/cmSourceFilesCommand.cxx
index 0d0f369..0655c20 100644
--- a/Source/cmSourceFilesCommand.cxx
+++ b/Source/cmSourceFilesCommand.cxx
@@ -17,16 +17,21 @@
#include "cmSourceFilesCommand.h"
#include <stdlib.h> // required for atof
+bool cmSourceFilesCommand::IsDeprecated(int major, int minor)
+{
+ if ( major >= 1 && minor >= 4 )
+ {
+ this->SetError("The SOURCE_FILES command was deprecated in CMake version 1.4 and will be removed in later versions of CMake. You should modify your CMakeLists.txt files to use the SET command instead, or set the cache value of CMAKE_BACKWARDS_COMPATIBILITY to 1.2 or less.\n");
+ return true;
+ }
+ return false;
+}
+
// cmSourceFilesCommand
bool cmSourceFilesCommand::InitialPass(std::vector<std::string> const& args)
{
const char* versionValue
= m_Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
- if (atof(versionValue) > 1.4)
- {
- this->SetError("The SOURCE_FILES command was deprecated in CMake version 1.4 and will be removed in later versions of CMake. You should modify your CMakeLists.txt files to use the SET command instead, or set the cache value of CMAKE_BACKWARDS_COMPATIBILITY to 1.2 or less.\n");
- return false;
- }
if (atof(versionValue) > 1.2)
{
cmSystemTools::Message("The SOURCE_FILES command was deprecated in CMake version 1.4 and will be removed in later versions. You should modify your CMakeLists.txt files to use the SET command instead, or set the cache value of CMAKE_BACKWARDS_COMPATIBILITY to 1.2 or less.\n","Warning");
diff --git a/Source/cmSourceFilesCommand.h b/Source/cmSourceFilesCommand.h
index 6d5c3fd..c2fd6f3 100644
--- a/Source/cmSourceFilesCommand.h
+++ b/Source/cmSourceFilesCommand.h
@@ -69,7 +69,12 @@ public:
{
return "Deprecated. Use SET to list sources in a variable.";
}
-
+
+ /**
+ * This determines if the method is deprecated or not
+ */
+ virtual bool IsDeprecated(int major, int minor);
+
/**
* More documentation.
*/