README.md 3.12 KB
Newer Older
Guillaume Pasero's avatar
Guillaume Pasero committed
1
# General
2

Guillaume Pasero's avatar
Guillaume Pasero committed
3 4
[![Build Status](https://travis-ci.org/orfeotoolbox/remote-module-template.svg?branch=master)](https://travis-ci.org/orfeotoolbox/remote-module-template)

Manuel Grizonnet's avatar
Manuel Grizonnet committed
5
This is a template module for the ORFEO
6 7 8 9
Toolbox(https://www.orfeo-toolbox.org/). It is designed to work with OTB >= 5.0
modular system. The module can be clone/copied in `OTB/Module/Remote` and
compiled along with other OTB modules. However, it is also possible to build it
as a standalone module.
10

11 12
This module is filled with a few templates to be used as a starting point for a
module with actual content. It contains the templates for:
Guillaume Pasero's avatar
Guillaume Pasero committed
13

14 15 16
* a library (`cxx` source in `src` folder)
* headers and templated classes (`include` folder)
* a OTB Application (`app` folder)
Guillaume Pasero's avatar
Guillaume Pasero committed
17 18 19
* tests for C++ sources, applications and python wrappers (`test` folder)

This module also has its own continuous integration scripts (using Travis CI).
20

Guillaume Pasero's avatar
Guillaume Pasero committed
21
# Getting Started
22

Guillaume Pasero's avatar
Guillaume Pasero committed
23 24
The official OTB Wiki documentation on adding an external module is
[here](http://wiki.orfeo-toolbox.org/index.php/How_to_write_a_remote_module).
25

Guillaume Pasero's avatar
Guillaume Pasero committed
26
## Remote Module
Manuel Grizonnet's avatar
Manuel Grizonnet committed
27 28 29 30 31 32

After a module has been created as a git repository it can be included
as a remote module, which enables automatic fetching. Add a file in
"OTB/Modules/Remote" called "YourModule.remote.cmake", for this module
it would be "ExternalExample.remote.cmake" with the followlowing contents:

Guillaume Pasero's avatar
Guillaume Pasero committed
33
```
Manuel Grizonnet's avatar
Manuel Grizonnet committed
34 35 36 37 38
otb_fetch_module(ExternalTemplate
  "A template for a module."
  GIT_REPOSITORY https://github.com/orfeotoolbox/otbExternalModuleTemplate
  GIT_TAG master
  )
Guillaume Pasero's avatar
Guillaume Pasero committed
39
```
Manuel Grizonnet's avatar
Manuel Grizonnet committed
40

Guillaume Pasero's avatar
Guillaume Pasero committed
41
### Editing
42

43
The files `CMakeLists.txt` and `otb-module.cmake` need to be modified with the name of the
Manuel Grizonnet's avatar
Manuel Grizonnet committed
44
module, something along the following:
45

Guillaume Pasero's avatar
Guillaume Pasero committed
46
```
Manuel Grizonnet's avatar
Manuel Grizonnet committed
47
sed 's/ExternalTemplate/MyModule/g' CMakeLists.txt otb-module.cmake
Guillaume Pasero's avatar
Guillaume Pasero committed
48
```
49

Manuel Grizonnet's avatar
Manuel Grizonnet committed
50 51
There is the inplace option to sed, but it's not portable, so do this change by
hand or look up the option in sed.
52

Manuel Grizonnet's avatar
Manuel Grizonnet committed
53
Then hack away at you code in include, src, test and app folders.
54

55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
### Continuous Integration

This module contains default files to enable Continuous Integration on
Travis-CI:

* `travis-ci.yml` : this is the backbone of the CI process in Travis-CI, it
  defines the different jobs to run, and their environment
* `ci.cmake` : this CTest script drives the build and test process.
* `vcvars_proxy.py` : this script is used on Windows to export variables from
  `vcvarsall.bat` to the Git-Bash executor.

The `README.md` starts with a Travis-CI badge, you can change it to match your
own module.

If you need to access data file from `OTB/Data`, you can tune the file
`ci.cmake` which will download them for you before building:

* `RM_GET_FULL_DATA`: this flag will download all files under `OTB/Data`
* `RM_DATA_PATTERNS`: this variable allows to download only the files you need.
  Set this variable to a list of patterns (for instance
  `Data/Input/QB_Toulouse_*.tif`). This method should be faster.

Guillaume Pasero's avatar
Guillaume Pasero committed
77
### License
78

Manuel Grizonnet's avatar
Manuel Grizonnet committed
79 80
This software is distributed under the Apache License. Please see LICENSE for
details.
81

82
### Authors
83

Manuel Grizonnet's avatar
Manuel Grizonnet committed
84
Manuel Grizonnet
85
Guillaume Pasero
Manuel Grizonnet's avatar
Manuel Grizonnet committed
86

Guillaume Pasero's avatar
Guillaume Pasero committed
87
### Thanks
88

Manuel Grizonnet's avatar
Manuel Grizonnet committed
89 90 91
It is a fork of the ITK template module provided by Bradley Lowekamp
(https://github.com/blowekamp/itkExternalTemplate.git) which was adapted for the
ORFEO ToolBox.