关于在CLion 的QT项目中,通过vcpkg安装log4cplus后,find_package无法搜索的问题

代码蜗牛sky 2024-07-18 11:12:41

 

如题,安装log4cplus后,在CMakeLists.txt添加 find_package(log4cplus REQUIRED),提示如下(如果是单独新建的非QT项目则正常),请问是什么原因:

CMake Error at D:/Qt/Qt5.14.2/5.14.2/mingw73_64/vcpkg/scripts/buildsystems/vcpkg.cmake:857 (_find_package):
  By not providing "Findlog4cplus.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "log4cplus", but CMake did not find one.

  Could not find a package configuration file provided by "log4cplus" with
  any of the following names:

    log4cplusConfig.cmake
    log4cplus-config.cmake

  Add the installation prefix of "log4cplus" to CMAKE_PREFIX_PATH or set
  "log4cplus_DIR" to a directory containing one of the above files.  If
  "log4cplus" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:23 (find_package)


-- Configuring incomplete, errors occurred!
See also "D:/SVN/Inforshare/CppSolutions/untitled16/cmake-build-debug/CMakeFiles/CMakeOutput.log".
 

...全文
460 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_31492247 2024-08-16
  • 打赏
  • 举报
回复
之前同时遇到过,问我我也没解决
qq_32966821 2024-07-18
  • 打赏
  • 举报
回复

阿西

寂然如故 2024-07-18
  • 打赏
  • 举报
回复

我之前也碰到了这个问题 ,不过忘记了怎么解决的了

16,818

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧