First clone mapnik from github and initialize submodules
```bash
git clone https://github.com/mapnik/mapnik.git
cd mapnik
git submodule update --init
```
Make sure that all dependencies are installed.
All available cmake options are listed at the top of [CMakeLists.txt](../CMakeLists.txt).
Pass your options while configuring e.g.: `cmake -DBUILD_DEMO_VIEWER=OFF ..` to disable the build of the demo viewer application.
To quickstart open a console in the root mapnik dir and execute the following commands: (Pass all options and dependency dirs after `-DBUILD_TEST=OFF`)
The install location of the plugins might be configuration dependent.
For each configuration there exists a variable `MAPNIK_PLUGINS_DIR_<CONFIGURATION>` where `<CONFIGURATION>` is one of `CMAKE_BUILD_TYPE` as upper case.
There is a function exported which you can use to query the plugin dir for known typical configurations:
```
mapnik_find_plugin_dir(MAPNIK_PLUGINS_DIR)
```
`MAPNIK_PLUGINS_DIR` will contain then the plugin dir. If a path could not be found, a warning is printed.
If you target a specific platform, it is recommended to create a toolchain file and set all the options and library path that you would normally set via cmd line options.
If you are using a recent cmake version (>=3.20), it is recommended to use a CMakePreset instead. https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html
## CMakePreset example
If you are using CMakePresets and need to add vcpkg integration, just create a `CMakeUserPresets.json` file beside `CMakePresets.json.