-
Notifications
You must be signed in to change notification settings - Fork 579
Adding Botan to your build
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:
- https://raw.githubusercontent.com/randombit/rnp/master/cmake/Modules/FindBotan2.cmake has a cmake script for detecting Botan version and features
- https://github.com/keepassxreboot/keepassxc/blob/develop/cmake/FindBotan.cmake
There is no official support for downloading and building Botan with CMake.
You could use one of the following CMake scripts instead:
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.
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.