CMake安装柯南时找不到POCO,

问题描述 投票:0回答:0

我从here下载了柯南的最新版本,然后我完成了以下操作。

  1. 创建一个新的 c++ 项目与休闲

main.cpp

 #include "Poco/MD5Engine.h"
 #include "Poco/DigestStream.h"

 #include <iostream>

 int main(int argc, char** argv)
 {
     Poco::MD5Engine md5;
     Poco::DigestOutputStream ds(md5);
     ds << "abcdefghijklmnopqrstuvwxyz";
     ds.close();
     std::cout << Poco::DigestEngine::digestToHex(md5.digest()) << std::endl;
     return 0;
 }

CMakeList.txt

cmake_minimum_required(VERSION 3.25)
project(TestMailPrj)

set(CMAKE_CXX_STANDARD 20)

find_package(poco REQUIRED)

add_executable(TestMailPrj main.cpp)
target_link_libraries(${PROJECT_NAME} POCO)

conanfile.txt

[requires]
cmake/3.25.3
poco/1.12.4

[generators]
CMakeDeps
CMakeToolchain
  1. 运行以下命令:
    conan install . --output-folder=build --build=missing

现在,即使我的所有依赖项都已正确安装,在 CMakeFile 中它也找不到我的 poco 库。

By not providing "Findpoco.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "poco", but CMake did not find one.
Could not find a package configuration file provided by "poco" with any of the following names:
  pocoConfig.cmake
  poco-config.cmake
Add the installation prefix of "poco" to CMAKE_PREFIX_PATH or set "poco_DIR" to a directory containing one of the above files. If "poco" provides a separate development package or SDK, be sure it has been installed.

有人知道我到底做错了什么还是这是一个错误?

c++ cmake poco-libraries conan conan-2
© www.soinside.com 2019 - 2024. All rights reserved.