当前位置:网站首页>解决CMakeList find_package找不到Qt5,找不到ECM
解决CMakeList find_package找不到Qt5,找不到ECM
2022-07-05 15:56:00 【新潮技术研究社】
在编译一个cmake项目的时候,需要用到ECM,于是使用vcpkg install ecm,结果安装成功,但是cmake依然不识别,find_package报错,找不到ecm位置,很显然,vcpkg安装ecm到packages路径下的时候,这个packages路径并没有被cmake查找到
这时候,我们需要在CMakeList文件中添加路径说明,也就是用到set了。
如下图所示,Qt5可以直接set,但是ECM,我却找不到ECM的路径怎么设置,Qt5_DIR我们经常看到,但是ECM_DIR却不曾看到过,很明显,试了试,不行。
然后尝试了将vcpkg中packages目录下的ecm安装目录下share目录直接拷贝到cmake share目录里,cmake成功找到了ecm,不过这也正常,cmake在自己家路径下找,肯定是能找到的。
find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} )
set(Qt5_DIR "D:\\Qt\\5.15.2\\msvc2019_64\\lib\\cmake\\Qt5")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg Concurrent)
边栏推荐
- Cs231n notes (top) - applicable to 0 Foundation
- Practice independent and controllable 3.0 and truly create the open source business of the Chinese people
- scratch五彩糖葫芦 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
- ES6深入—ES6 Generator 函数
- list去重并统计个数
- Quelques réflexions cognitives
- List uses stream flow to add according to the number of certain attributes of the element
- Cartoon: what is service fusing?
- PSPNet | 语义分割及场景分析
- 10分钟帮你搞定Zabbix监控平台告警推送到钉钉群
猜你喜欢

Five common negotiation strategies of consulting companies and how to safeguard their own interests

怎样在电脑上设置路由器的WiFi密码

【学术相关】多位博士毕业去了三四流高校,目前惨不忍睹……

List de duplication and count the number
![[deep learning] how does deep learning affect operations research?](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[deep learning] how does deep learning affect operations research?

项目中批量update

StarkWare:欲构建ZK“宇宙”

The difference between abstract classes and interfaces

DeSci:去中心化科学是Web3.0的新趋势?

Single merchant v4.4 has the same original intention and strength!
随机推荐
求解汉诺塔问题【修改版】
Batch update in the project
Find the root of the following equation by chord cutting method, f (x) =x^3-5x^2+16x-80=0
The database of the server is not connected to 200310060 "unknown error" [the service is up, the firewall is off, the port is on, and the netlent port is not connected]
Quelques réflexions cognitives
新春限定丨“牛年忘烦”礼包等你来领~
Pits encountered in the use of boolean type in development
Background system sending verification code function
list使用Stream流进行根据元素某属性数量相加
异常com.alibaba.fastjson.JSONException: not match : - =
自己要有自己的坚持
This article takes you through the addition, deletion, modification and query of JS processing tree structure data
PSPNet | 语义分割及场景分析
给自己打打气
《21天精通TypeScript-3》-安装搭建TypeScript开发环境.md
Which keywords will conflict with the abstract keyword
StarkWare:欲构建ZK“宇宙”
国泰君安网上开户安全吗
[深度学习][原创]让yolov6-0.1.0支持yolov5的txt读取数据集模式
tf.sequence_mask函数讲解案例