【发布时间】:2019-02-04 11:29:58
【问题描述】:
我使用 vcpkg 作为我的包管理器,按照示例使用 sqlite 构建 example 非常容易。
之后我成功安装了botan并尝试使用
find_package(botan REQUIRED) 如示例 here 所示。
但是不幸的是,这不起作用,并且生成退出并出现错误
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包?硬编码位置不是一个可行的解决方案。
感谢四位的帮助。
【问题讨论】:
-
使用 powershell 和 vcpkg 安装 botan,无需 cmake。 IDE是VC2017?
-
@seccpur 如果可能的话,我想使用 CMake 来在不同的平台上编译它。我安装了botan,但是CMake没有找到它。
-
vcpkg 现在可以安装 botan,但
find_package(botan REQUIRED)仍然失败并出现同样的错误