1--- 2short-description: Project templates 3... 4 5# Project templates 6 7To make it easier for new developers to start working, Meson ships a 8tool to generate the basic setup of different kinds of projects. This 9functionality can be accessed with the `meson init` command. A typical 10project setup would go like this: 11 12```console 13$ mkdir project_name 14$ cd project_name 15$ meson init --language=c --name=myproject --version=0.1 16``` 17 18This would create the build definitions for a helloworld type 19project. The result can be compiled as usual. For example it 20could be done like this: 21 22``` 23$ meson setup builddir 24$ meson compile -C builddir 25``` 26 27The generator has many different projects and settings. They can all 28be listed by invoking the command `meson init --help`. 29 30This feature is available since Meson version 0.45.0. 31 32# Generate a build script for an existing project 33 34With `meson init` you can generate a build script for an existing 35project with existing project files by running the command in the 36root directory of your project. Meson currently supports this 37feature for `executable`, and `jar` projects. 38 39# Build after generation of template 40 41It is possible to have Meson generate a build directory from the 42`meson init` command without running `meson setup`. This is done 43by passing `-b` or `--build` switch. 44 45```console 46$ mkdir project_name 47$ cd project_name 48$ meson init --language=c --name=myproject --version=0.1 --build 49```