Skip to content

Adding Botan to your build

Philippe Lieser edited this page Apr 28, 2024 · 7 revisions

CMake

Use an installed Botan

Starting with version 3.3.0 Botan includes botan-config.cmake module to discover the installed library binaries and headers. More information is available in the Building The Library chapter of the handbook.

For older Botan versions you could use one of the following find modules:

Use CMake to download and build Botan

There is no official support for downloading and building Botan with CMake.

You could use one of the following CMake scripts instead:

Conan

Botan is available in conan-center and can be integrated as a Conan dependency via botan/x.y.z. The associated recipe is maintained in conan-center-index.

Visual Studio

Build Botan using the Visual Studio Developer Command Prompt. Make sure to use the command prompt matching your target architecture when building Botan, e.g., when building Botan for amd64 use the x64 Native Tools Command Prompt.

To link your application against Botan, update the following of your Visual Studio project's properties:

  • VC++ Directories -> Include Directories: Add path to Botan headers, e.g., C:\Botan\include
  • VC++ Directories -> Library Directories: Add path to botan-3.lib, e.g., C:\Botan
  • Linker -> Input -> Additional Dependencies: Add botan-3.lib

Be careful when mixing debug and release builds as this might result in hard to diagnose issues on Windows.