Explorar el Código

ENH: Patch from Alex to add IsDiscouraged method for future use in generating separate documentation for old commands. Also modified documentation of MAKE_DIRECTORY and REMOVE commands to indicate they should not be used.

Brad King hace 19 años
padre
commit
f12742d6cd

+ 6 - 0
Source/cmBuildNameCommand.h

@@ -72,6 +72,12 @@ public:
       "CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables.";
       "CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables.";
     }
     }
 
 
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmBuildNameCommand, cmCommand);
   cmTypeMacro(cmBuildNameCommand, cmCommand);
 };
 };
 
 

+ 9 - 0
Source/cmCommand.h

@@ -101,6 +101,15 @@ public:
     return false;
     return false;
     }
     }
 
 
+  /**
+   * This determines if usage of the method is discouraged or not.
+   * This is currently only used for generating the documentation.
+   */
+  virtual bool IsDiscouraged()
+    {
+    return false;
+    }
+
   /**
   /**
    * The name of the command as specified in CMakeList.txt.
    * The name of the command as specified in CMakeList.txt.
    */
    */

+ 6 - 0
Source/cmExecProgramCommand.h

@@ -88,6 +88,12 @@ public:
       ;
       ;
     }
     }
   
   
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmExecProgramCommand, cmCommand);
   cmTypeMacro(cmExecProgramCommand, cmCommand);
 };
 };
 
 

+ 6 - 0
Source/cmInstallFilesCommand.h

@@ -94,6 +94,12 @@ public:
       "is stored in the variable CMAKE_INSTALL_PREFIX.";
       "is stored in the variable CMAKE_INSTALL_PREFIX.";
     }
     }
   
   
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmInstallFilesCommand, cmCommand);
   cmTypeMacro(cmInstallFilesCommand, cmCommand);
 
 
 protected:
 protected:

+ 6 - 0
Source/cmInstallProgramsCommand.h

@@ -90,6 +90,12 @@ public:
       "is stored in the variable CMAKE_INSTALL_PREFIX.";
       "is stored in the variable CMAKE_INSTALL_PREFIX.";
     }
     }
   
   
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmInstallProgramsCommand, cmCommand);
   cmTypeMacro(cmInstallProgramsCommand, cmCommand);
 
 
 protected:
 protected:

+ 6 - 0
Source/cmInstallTargetsCommand.h

@@ -72,6 +72,12 @@ public:
       "(Windows DLL), the files will be copied to that directory.";
       "(Windows DLL), the files will be copied to that directory.";
     }
     }
   
   
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmInstallTargetsCommand, cmCommand);
   cmTypeMacro(cmInstallTargetsCommand, cmCommand);
 };
 };
 
 

+ 6 - 0
Source/cmLinkLibrariesCommand.h

@@ -75,6 +75,12 @@ public:
       "type of build.";
       "type of build.";
     }
     }
   
   
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmLinkLibrariesCommand, cmCommand);
   cmTypeMacro(cmLinkLibrariesCommand, cmCommand);
 };
 };
 
 

+ 10 - 1
Source/cmMakeDirectoryCommand.h

@@ -60,7 +60,7 @@ public:
    */
    */
   virtual const char* GetTerseDocumentation() 
   virtual const char* GetTerseDocumentation() 
     {
     {
-    return "Create a directory on the file system.";
+    return "Old directory creation command.  Use the FILE command.";
     }
     }
   
   
   /**
   /**
@@ -69,12 +69,21 @@ public:
   virtual const char* GetFullDocumentation()
   virtual const char* GetFullDocumentation()
     {
     {
     return
     return
+      "This command has been superceded by the FILE(MAKE_DIRECTORY ...) "
+      "command.  "
+      "It is provided for compatibility with older CMake code.\n"
       "  MAKE_DIRECTORY(directory)\n"
       "  MAKE_DIRECTORY(directory)\n"
       "Creates the specified directory.  Full paths should be given.  Any "
       "Creates the specified directory.  Full paths should be given.  Any "
       "parent directories that do not exist will also be created.  Use with "
       "parent directories that do not exist will also be created.  Use with "
       "care.";
       "care.";
     }
     }
   
   
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmMakeDirectoryCommand, cmCommand);
   cmTypeMacro(cmMakeDirectoryCommand, cmCommand);
 };
 };
 
 

+ 9 - 1
Source/cmRemoveCommand.h

@@ -56,7 +56,7 @@ public:
    */
    */
   virtual const char* GetTerseDocumentation() 
   virtual const char* GetTerseDocumentation() 
     {
     {
-    return "Remove a value from a list in a variable.";
+    return "Old list item removal command.  Use the LIST command.";
     }
     }
   
   
   /**
   /**
@@ -65,12 +65,20 @@ public:
   virtual const char* GetFullDocumentation()
   virtual const char* GetFullDocumentation()
     {
     {
     return
     return
+      "This command has been superceded by the LIST(REMOVE ...) command.  "
+      "It is provided for compatibility with older CMake code.\n"
       "  REMOVE(VAR VALUE VALUE ...)\n"
       "  REMOVE(VAR VALUE VALUE ...)\n"
       "Removes VALUE from the variable VAR.  "
       "Removes VALUE from the variable VAR.  "
       "This is typically used to remove entries from a vector "
       "This is typically used to remove entries from a vector "
       "(e.g. semicolon separated list).  VALUE is expanded.";
       "(e.g. semicolon separated list).  VALUE is expanded.";
     }
     }
   
   
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+  
   cmTypeMacro(cmRemoveCommand, cmCommand);
   cmTypeMacro(cmRemoveCommand, cmCommand);
 };
 };
 
 

+ 6 - 0
Source/cmSubdirCommand.h

@@ -80,6 +80,12 @@ public:
       "top level project or be built each time make is run from the top.";
       "top level project or be built each time make is run from the top.";
     }
     }
   
   
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmSubdirCommand, cmCommand);
   cmTypeMacro(cmSubdirCommand, cmCommand);
 };
 };
 
 

+ 6 - 0
Source/cmSubdirDependsCommand.h

@@ -67,6 +67,12 @@ public:
       "parallel builds correctly.  This functionality is now automatic.";
       "parallel builds correctly.  This functionality is now automatic.";
     }
     }
   
   
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmSubdirDependsCommand, cmCommand);
   cmTypeMacro(cmSubdirDependsCommand, cmCommand);
 };
 };
 
 

+ 6 - 0
Source/cmVTKMakeInstantiatorCommand.h

@@ -75,6 +75,12 @@ public:
       "C++ code.";
       "C++ code.";
     }
     }
   
   
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   cmTypeMacro(cmVTKMakeInstantiatorCommand, cmCommand);
   cmTypeMacro(cmVTKMakeInstantiatorCommand, cmCommand);
   
   
 protected:
 protected:

+ 6 - 0
Source/cmVTKWrapJavaCommand.h

@@ -77,6 +77,12 @@ public:
       "Create Java wrappers for VTK classes.";
       "Create Java wrappers for VTK classes.";
     }
     }
   
   
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
 private:
 private:
   std::vector<cmSourceFile> WrapClasses;
   std::vector<cmSourceFile> WrapClasses;
   std::vector<std::string> WrapHeaders;
   std::vector<std::string> WrapHeaders;

+ 6 - 0
Source/cmVTKWrapPythonCommand.h

@@ -77,6 +77,12 @@ public:
       "Create Python wrappers for VTK classes.";
       "Create Python wrappers for VTK classes.";
     }
     }
 
 
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   /**
   /**
    * Helper methods
    * Helper methods
    */
    */

+ 6 - 0
Source/cmVTKWrapTclCommand.h

@@ -79,6 +79,12 @@ public:
       "Create Tcl wrappers for VTK classes.";
       "Create Tcl wrappers for VTK classes.";
     }
     }
 
 
+  /** This command is only kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
+
   /**
   /**
    * Helper methods
    * Helper methods
    */
    */