Update How to deprecate authored by Antoine Regimbeau's avatar Antoine Regimbeau
So you want to deprecate something in OTB? Follow the guide: So you want to deprecate something in OTB? Follow the guide:
#### A C++ class #### A C++ class (WIP)
In the doxygen documentation of the class, add the `\deprecated` keyword. In the doxygen documentation of the class, add the `\deprecated` keyword.
In the class declaration, use the `[[deprecated]]` attribute. If the class declaration already has an export macro, use the macro `_DEPRECATED_EXPORT`. In the class declaration, use the `[[deprecated]]` attribute. If the class declaration already has an export macro, use the macro `_DEPRECATED_EXPORT`.
#### A method of a C++ class #### A method of a C++ class (WIP)
Use the `[[deprecated]]` attribute. Use the `[[deprecated]]` attribute.
#### A part of the Python API #### A part of the Python API (WIP)
TODO
#### An OTB application #### An OTB application (WIP)
Add the tag deprecated: Add the tag deprecated:
...@@ -23,8 +22,44 @@ AddDocTag(Tags::Deprecated); ...@@ -23,8 +22,44 @@ AddDocTag(Tags::Deprecated);
``` ```
#### An OTB module #### An OTB module
An OTB module can be deprecated thanks to the `otb_module` macro in the `otb-module.cmake`. One just need to add the key word `DEPRECATED` the arguments.
Here is an example of th `otb-module.cmake` of a deprecated module :
```CMake
set(DOCUMENTATION "Some documentation")
otb_module(OTBDeprecatedModuleName
DEPENDS
OTBSomeDependencies
Add the keyword `DEPRECATED` in the call to `otb_module()` macro in file `otb-module.cmake` TEST_DEPENDS
OTBTestKernel
OTBSomeOtherDependenciesForTest
DEPRECATED
DESCRIPTION
"${DOCUMENTATION}"
)
```
One need to make sure that the deprecated module is not a mandatory dependency of any other module. One can still allow the module to be use thanks to the `OPTIONAL_DEPENDS` key word :
```CMake
set(DOCUMENTATION "Some documentation")
otb_module(OTBDModuleName
DEPENDS
OTBSomeDependencies
OPTIONAL_DEPENDS
OTBSomeOptionalDependencies
OTBSomeDeprecatedModule
TEST_DEPENDS
OTBTestKernel
OTBSomeOtherDependenciesForTest
DESCRIPTION
"${DOCUMENTATION}"
)
```
#### How to disable deprecated features when `OTB_USE_DEPRECATED=OFF`? #### How to disable deprecated features when `OTB_USE_DEPRECATED=OFF`?
... ...
......