我使用 vcpkg 作为我的包管理器,按照示例使用 sqlite构建示例非常容易。
之后我成功安装了 botan 并尝试使用
此处find_package(botan REQUIRED)
示例中所示的方法查找库。然而不幸的是,这不起作用,并且一代退出并出现错误
CMake Error at vcpkg/scripts/buildsystems/vcpkg.cmake:247 (_find_package):
By not providing "Findbotan.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "botan", but
CMake did not find one.
Could not find a package configuration file provided by "botan" with any of
the following names:
botanConfig.cmake
botan-config.cmake
Add the installation prefix of "botan" to CMAKE_PREFIX_PATH or set
"botan_DIR" to a directory containing one of the above files. If "botan"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:4 (find_package
CMakeLists.txt 如下所示
cmake_minimum_required(VERSION 3.0)
project(botanTest)
find_package(botan REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main botan)
有没有办法使用 cmake 和 vcpkg 构建依赖于 botan 的应用程序?如果不是cmake,如何将botan用作vcpkg包?对位置进行硬编码不是可行的解决方案。
谢谢四爷的帮助。