gpt4 book ai didi

cmake - 调试 CMake find_library

转载 作者:行者123 更新时间:2023-12-04 20:29:45 29 4
gpt4 key购买 nike

是否可以调试find_library来自 CMake?

我想要的是经过考虑的路径列表。我的用例是一个像

find_library (FOO_LIBRARY
NAMES foo foo.so.0)

还有 /lib64/libfoo.so.0在我的系统上。但是 CMake 没有找到它。我查了一下 FIND_LIBRARY_USE_LIB64_PATHS设置为 TRUE .

最佳答案

使用 CMake 3.17 这个 got added :

The “CMAKE_FIND_DEBUG_MODE” variable was introduced to print extra find call information during the cmake run to standard error. Output is designed for human consumption and not for parsing.



所以你通过 -DCMAKE_FIND_DEBUG_MODE=true--debug-find到您的 CMake 命令。

以下是搜索 libFOO 时的示例输出:
find_library considered the following locations:

/usr/local/lib64/(lib)FOO(\.so|\.a)
/usr/local/lib/(lib)FOO(\.so|\.a)
/usr/local/lib64/(lib)FOO(\.so|\.a)
/usr/local/lib/(lib)FOO(\.so|\.a)
/usr/local/lib64/(lib)FOO(\.so|\.a)
/usr/local/(lib)FOO(\.so|\.a)
/usr/lib64/(lib)FOO(\.so|\.a)
/usr/lib/(lib)FOO(\.so|\.a)
/usr/lib64/(lib)FOO(\.so|\.a)
/usr/lib/(lib)FOO(\.so|\.a)
/usr/lib64/(lib)FOO(\.so|\.a)
/usr/(lib)FOO(\.so|\.a)
/lib64/(lib)FOO(\.so|\.a)
/lib/(lib)FOO(\.so|\.a)
/opt/(lib)FOO(\.so|\.a)

The item was not found.

关于cmake - 调试 CMake find_library,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49431342/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com