diff --git a/INSTALL.md b/INSTALL.md index 4ef4a2124..7ee6420c0 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,6 +2,13 @@ Mapnik runs on Linux, OS X, Windows, and BSD systems. +## Package managers +### vcpkg +To install mapnik with vcpkg type `vcpkg install mapnik`. It will install a minimal version of mapnik and all the needed dependencies. +To install more features, type `vcpkg search mapnik` to see all available features. + +## Source build + First clone mapnik from github and initialize submodules ```bash diff --git a/docs/cmake-usage.md b/docs/cmake-usage.md new file mode 100644 index 000000000..e3d4e84a7 --- /dev/null +++ b/docs/cmake-usage.md @@ -0,0 +1,34 @@ +# Usage with CMake +## Build +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`) +``` +> cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TEST=OFF +> cmake --build build --target install +``` + +## Usage + +To use Mapnik in your project add the following lines to your CMakeLists.tzt. +``` +find_package(mapnik CONFIG REQUIRED) +[...] +target_link_libraries(mytarget ... mapnik::headers mapnik::mapnik) +``` + +All mapnik executables and targets are exported within `MapnikTargets.cmake`. + +The plugin dir is available in the variable `MAPNIK_PLUGINS_DIR`. +The font path is is available in the variable `MAPNIK_FONTS_DIR`.