Basic prerequisites
The waf-extension wtools
is designed to make it easy to work with the standard languages and libraries used at ESO. For this reason there are built-in knowledge and dependencies to a a few libraries and tools. If the standard ELT development environment is used, all dependencies should be satisfied already.
The dependencies are:
- boost
- google test
- qt5
- clang-tidy
- pylint
The waf
installation also needs to have some extras built in:
- boost
- qt5
- color_gcc
- doxygen
- pytest
- javatest
- protoc
Starting a new project
Create a directory to act as the root of the new project, this directory is from this point referred to the project root
.
The project root needs to two things:
- wtools
- A wscript declaring the project.
Assuming you are using subversion and have created an empty project root directory the following steps describes the basic setup:
- Checkout the empty project:
$ svn co <path-to-project-root>
- Navigate into the project root:
$ cd <project-root>
- Set up the wtools as an external:
$ svn propset svn:externals "wtools http://svnhq9.hq.eso.org/p9/trunk/EELT/DevEnv/wtools/wtools" .
- Update svn to fetch the external:
$ svn update
- Edit wscript and declare project:
2 from wtools
import project
8 project.declare_project(name=
'Example',
10 requires=
'cxx qt5 python',
- The
requires
parameter specifies which features the project needs (c.f. project requires)
- Add modules and packages in the structure you prefer c.f. basic project as defined in the
recurse
definition of the project.
Project requires
Possible project requires can be queried to wtools by inserting an invalid entry in the requires parameter. This is an example output generated:
cxx:
| Provides C/C++ support including
| - Google Test (unit testing)
| - Clang Tidy (linting)
|
| Enables the following tools/features:
| - cxx
| - compiler_c
| - compiler_cxx
| - color_gcc
| - waf_unit_test
| - buildcopy
pyqt5 (requires python):
| Provides Qt5 for Python support
|
| Enables the following tools/features:
| - pyqt5
java:
| Provides Java support
|
| Enables the following tools/features:
| - java
| - javatest
qt5 (requires cxx):
| Provides Qt5 for C++ support
|
| Enables the following tools/features:
| - qt5
rtidds (requires cxx):
| Provides RTIDDS C++ support
|
| Enables the following tools/features:
| - rti_idl
protoc (requires cxx):
| Provides Google Protobuffer C++ support
|
| Enables the following tools/features:
| - protoc
boost (requires cxx):
| Provides C++ boost libraries support (available as use='BOOST')
| It is further configured with attribute boost_libs attribute, e.g.:
| `boost_libs='program_options datetime'`
|
| Enables the following tools/features:
| - boost
python:
| Provides Python support:
| - Python3.5+
| - Nosetests (unit testing)
| - Pylint (linting)
|
| Enables the following tools/features:
| - python
| - pytest
| - waf_unit_test
| - buildcopy