CMake find_package:它在哪里找到包? [英] CMake find_package: where did it find the package?

查看:709
本文介绍了CMake find_package:它在哪里找到包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的CMake程序包中,有一个对find_package的调用.这成功了,太好了!但是,事实证明这是该软件包的错误版本.我现在要删除该程序包.但是,我不知道它在系统上的什么位置,也不知道CMake必须在哪里找到-config.cmake文件.有没有办法让find_package给我这些信息?还是至少详细地告诉我它在哪里搜索?

In my CMake package, there is a call to find_package. This succeeds, great! However, it turns out to be the wrong version of the package. I now want to go and delete that package. However, I have no idea where the heck it is on my system, nor where the -config.cmake file is that CMake must have found somewhere. Is there a way to get find_package to give me this information? Or at least verbosely tell me where it is searching?

我虽然这可能在变量CMAKE_MODULE_PATH中,但是对我来说这是空的.所以我猜它在默认路径中的某个地方.但是CMake在很多地方搜索软件包,但在我记得的通常位置都找不到它.

I though this might be in the variable CMAKE_MODULE_PATH, however that is empty for me. So I guess it is in the default paths somewhere. But CMake searches a lot of places for packages, and I didn't find it in the usual locations that I remember.

推荐答案

好的,我在这里找到了解决方案:

Ah ok, I found a solution here:

https://riptutorial.com/cmake/example/21128/debug-find-package ---错误

结果是有一个特殊的调试标志来使find_package告诉您它在哪里搜索:​​

Turns out there is a special debug flag to make find_package tell you where it is searching:

cmake -D CMAKE_FIND_DEBUG_MODE=ON ..

这篇关于CMake find_package:它在哪里找到包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆