本文介绍了获取cmake和自制啤酒一起工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我安装库与homebrew cmake似乎无法找到他们。
When I install libraries with homebrew cmake can't seem to find them. Is there a simple way to fix this for an arbitrary library installed with brew.
推荐答案
默认
默认情况下,brew的库安装到 / usr / local / lib
文件夹:
> ls /usr/local/lib/liblzma.dylib
/usr/local/lib/liblzma.dylib@
检查此路径是否存在于变量中。在这种情况下
find是微不足道的:
Check that this path exists in CMAKE_SYSTEM_PREFIX_PATH variable. In this casefind is trivial:
message("system: ${CMAKE_SYSTEM_PREFIX_PATH}")
find_library(LZMA_LIBRARY lzma)
message("lzma: ${LZMA_LIBRARY}")
结果:
system: /usr/local;/usr;/;...
lzma: /usr/local/lib/liblzma.dylib
否则
如果不是,您需要修改或
之前命令:
list(APPEND CMAKE_PREFIX_PATH /usr/local)
这篇关于获取cmake和自制啤酒一起工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!