Skip to content

Instantly share code, notes, and snippets.

@dschulz
Created May 10, 2022 20:45
Show Gist options
  • Save dschulz/b4bd758784175f57ded0b61b660ab3ab to your computer and use it in GitHub Desktop.
Save dschulz/b4bd758784175f57ded0b61b660ab3ab to your computer and use it in GitHub Desktop.
add Botan2 library to a Qt6 project
# Include FindBotan2.cmake in ${PROJECT_ROOT}/cmake
# https://github.com/rnpgp/rnp/blob/master/cmake/Modules/FindBotan2.cmake
# Then add this
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(Botan2 REQUIRED)
if(BOTAN2_VERSION VERSION_LESS "2.19.1")
message(FATAL_ERROR "Botan2 2.19.1 or higher is required")
endif()
include_directories(SYSTEM ${BOTAN2_INCLUDE_DIR})
# Beneath the other target_link_libraries(...) lines
target_link_libraries(MyProjectName PRIVATE ${BOTAN2_LIBRARIES} )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment