如何将Find_library的结果添加到Cmakelist?
正在阅读以下内容:
我对Cmake的了解不多,
find_library(libiconv NAMES libiconv)
find_library(libz NAMES libz)
我相信以上行会发现一些丢失的库,但是要使事情正常工作,我需要将结果添加到库列表中。
如何添加结果?
Was reading this:
https://discuss.cocos2d-x.org/t/xcode-12-2-errors-when-ios-simulator-with-cocos2d-x-4-0/52203/22
I don't know much about CMake
find_library(libiconv NAMES libiconv)
find_library(libz NAMES libz)
I believe the above lines will find some missing libraries, but to get things to work, I need to add the result to the library list.
How do I add the result ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
find_library
填充您将其作为第一个参数传递的变量,并使用找到的库路径(如果有)。因此,您在target_link_libraries
命令中使用此变量。这样就是这样:另外,您应该先熟悉Cmake,因为您显然不知道自己在做什么。两者 zlib & iconv
find_library
populates the variable which you pass as the first argument with the found library path, if any. So you use this variable intarget_link_libraries
command. It would be something like this:Also you should get familiar with CMake first because you clearly don't know what you are doing. Both zlib & iconv have find modules so what you really want to do is this: