| 1 |
--- |
| 2 |
short-description: Converting other build systems to Meson |
| 3 |
... |
| 4 |
|
| 5 |
# Build system converters |
| 6 |
|
| 7 |
Moving from one build system into another includes a fair bit of |
| 8 |
work. To make things easier, Meson provides scripts to convert other |
| 9 |
build systems into Meson. At the time of writing, scripts for CMake |
| 10 |
and autotools exist. It can be found in the `tools` subdirectory in |
| 11 |
Meson's source tree. |
| 12 |
|
| 13 |
The scripts do not try to do a perfect conversion. This would be |
| 14 |
extremely difficult because the data models of other build systems are |
| 15 |
very different. The goal of the converter script is to convert as much |
| 16 |
of the low level drudgery as possible. Using the scripts is |
| 17 |
straightforward. We'll use the CMake one as an example but the |
| 18 |
Autotools one works exactly the same way. |
| 19 |
|
| 20 |
cmake2meson.py path/to/CMake/project/root |
| 21 |
|
| 22 |
This command generates a skeleton Meson project definition that tries |
| 23 |
to mirror CMake's setup as close as possible. Once this is done, you |
| 24 |
need to go through these files manually and finalize the |
| 25 |
conversion. To make this task as simple as possible, the converter |
| 26 |
script will transfer all comments from the CMake definition into Meson |
| 27 |
definition. |