From f12742d6cdffd62378a4bbf8eeff0c552d2d9093 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 31 Aug 2006 13:20:12 -0400 Subject: [PATCH] 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. --- Source/cmBuildNameCommand.h | 6 ++++++ Source/cmCommand.h | 9 +++++++++ Source/cmExecProgramCommand.h | 6 ++++++ Source/cmInstallFilesCommand.h | 6 ++++++ Source/cmInstallProgramsCommand.h | 6 ++++++ Source/cmInstallTargetsCommand.h | 6 ++++++ Source/cmLinkLibrariesCommand.h | 6 ++++++ Source/cmMakeDirectoryCommand.h | 11 ++++++++++- Source/cmRemoveCommand.h | 10 +++++++++- Source/cmSubdirCommand.h | 6 ++++++ Source/cmSubdirDependsCommand.h | 6 ++++++ Source/cmVTKMakeInstantiatorCommand.h | 6 ++++++ Source/cmVTKWrapJavaCommand.h | 6 ++++++ Source/cmVTKWrapPythonCommand.h | 6 ++++++ Source/cmVTKWrapTclCommand.h | 6 ++++++ 15 files changed, 100 insertions(+), 2 deletions(-) diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h index 183b0973b6..174f1f98ec 100644 --- a/Source/cmBuildNameCommand.h +++ b/Source/cmBuildNameCommand.h @@ -72,6 +72,12 @@ public: "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); }; diff --git a/Source/cmCommand.h b/Source/cmCommand.h index 7466bb54d8..55672a658c 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -101,6 +101,15 @@ public: 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. */ diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h index 339bda84aa..64d2f513ed 100644 --- a/Source/cmExecProgramCommand.h +++ b/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); }; diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h index 80b1cda55e..826e5ed5cf 100644 --- a/Source/cmInstallFilesCommand.h +++ b/Source/cmInstallFilesCommand.h @@ -94,6 +94,12 @@ public: "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); protected: diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h index 2cd6d1ea59..e922af2f02 100644 --- a/Source/cmInstallProgramsCommand.h +++ b/Source/cmInstallProgramsCommand.h @@ -90,6 +90,12 @@ public: "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); protected: diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h index 10ab4570cf..ec1d7c8863 100644 --- a/Source/cmInstallTargetsCommand.h +++ b/Source/cmInstallTargetsCommand.h @@ -72,6 +72,12 @@ public: "(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); }; diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h index bd6e80e15d..2f336895b8 100644 --- a/Source/cmLinkLibrariesCommand.h +++ b/Source/cmLinkLibrariesCommand.h @@ -75,6 +75,12 @@ public: "type of build."; } + /** This command is only kept for compatibility with older CMake versions. */ + virtual bool IsDiscouraged() + { + return true; + } + cmTypeMacro(cmLinkLibrariesCommand, cmCommand); }; diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h index a25a8d4477..7380bcbe65 100644 --- a/Source/cmMakeDirectoryCommand.h +++ b/Source/cmMakeDirectoryCommand.h @@ -60,7 +60,7 @@ public: */ 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() { 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" "Creates the specified directory. Full paths should be given. Any " "parent directories that do not exist will also be created. Use with " "care."; } + /** This command is only kept for compatibility with older CMake versions. */ + virtual bool IsDiscouraged() + { + return true; + } + cmTypeMacro(cmMakeDirectoryCommand, cmCommand); }; diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h index a1de0101b9..b7ca5a7a6d 100644 --- a/Source/cmRemoveCommand.h +++ b/Source/cmRemoveCommand.h @@ -56,7 +56,7 @@ public: */ 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() { 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" "Removes VALUE from the variable VAR. " "This is typically used to remove entries from a vector " "(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); }; diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h index 71cc31e0a0..4ec3da98d8 100644 --- a/Source/cmSubdirCommand.h +++ b/Source/cmSubdirCommand.h @@ -80,6 +80,12 @@ public: "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); }; diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h index 3e9760259c..f17844303b 100644 --- a/Source/cmSubdirDependsCommand.h +++ b/Source/cmSubdirDependsCommand.h @@ -67,6 +67,12 @@ public: "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); }; diff --git a/Source/cmVTKMakeInstantiatorCommand.h b/Source/cmVTKMakeInstantiatorCommand.h index 377cf75817..a8ed52ac7b 100644 --- a/Source/cmVTKMakeInstantiatorCommand.h +++ b/Source/cmVTKMakeInstantiatorCommand.h @@ -75,6 +75,12 @@ public: "C++ code."; } + /** This command is only kept for compatibility with older CMake versions. */ + virtual bool IsDiscouraged() + { + return true; + } + cmTypeMacro(cmVTKMakeInstantiatorCommand, cmCommand); protected: diff --git a/Source/cmVTKWrapJavaCommand.h b/Source/cmVTKWrapJavaCommand.h index 2532bd2b2c..6ffaa52850 100644 --- a/Source/cmVTKWrapJavaCommand.h +++ b/Source/cmVTKWrapJavaCommand.h @@ -77,6 +77,12 @@ public: "Create Java wrappers for VTK classes."; } + /** This command is only kept for compatibility with older CMake versions. */ + virtual bool IsDiscouraged() + { + return true; + } + private: std::vector WrapClasses; std::vector WrapHeaders; diff --git a/Source/cmVTKWrapPythonCommand.h b/Source/cmVTKWrapPythonCommand.h index b92b65a2c9..8e58b2400c 100644 --- a/Source/cmVTKWrapPythonCommand.h +++ b/Source/cmVTKWrapPythonCommand.h @@ -77,6 +77,12 @@ public: "Create Python wrappers for VTK classes."; } + /** This command is only kept for compatibility with older CMake versions. */ + virtual bool IsDiscouraged() + { + return true; + } + /** * Helper methods */ diff --git a/Source/cmVTKWrapTclCommand.h b/Source/cmVTKWrapTclCommand.h index 77488bcbff..85c442a0d6 100644 --- a/Source/cmVTKWrapTclCommand.h +++ b/Source/cmVTKWrapTclCommand.h @@ -79,6 +79,12 @@ public: "Create Tcl wrappers for VTK classes."; } + /** This command is only kept for compatibility with older CMake versions. */ + virtual bool IsDiscouraged() + { + return true; + } + /** * Helper methods */