CMake的:FIND_PACKAGE(线程)为Android交叉编译 [英] CMake : FIND_PACKAGE(Threads) for Android cross-compilation

查看:1117
本文介绍了CMake的:FIND_PACKAGE(线程)为Android交叉编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了Android NDK和cmake的生成我的项目共享库。

I'm using the Android NDK and Cmake to generate shared libraries of my project.

我移植从Ubuntu的到Android现有项目,而现在我需要一些端口的可执行文件。我成功编译的所有可执行文件sexecpt其中一个需要主题库。

I'm porting an existing project from Ubuntu to Android, and right now I need to port some executables files. I compile successfully all the executable file sexecpt one which needs the Threads library.

在CMakeList.txt,有 FIND_PACKAGE(线程)其中找到库在编译的Ubuntu,而不是为Android。

In CMakeList.txt, there is FIND_PACKAGE(Threads) which finds the library while compiling for Ubuntu, but not for Android.

我跟着这个 cmake并的libpthread,但没有成功。

I followed this cmake and libpthread but with no success.

我觉得我应该写在 FindThread.cmake 文件,但我是pretty新CMake的和真的不知道该怎么做,尤其是我不知道在哪里位于Android的线程库。

I think I should write the FindThread.cmake file but I'm pretty new to CMake and don't really know how to do it, especially as I don't know where is located the thread library for Android.

任何帮助将是AP preciated。
谢谢

Any help would be appreciated. Thank you

推荐答案

您不必编写自己的FindThread.cmake。在一个标准的Linux安装,它可以在/usr/share/cmake-2.8/Modules/被发现。

You don't need to write your own FindThread.cmake. On a standard linux installation, it can be found within /usr/share/cmake-2.8/Modules/ .

检查,其中该模块/目录可能你的平台上进行安装。

Check where this Modules/ directory might be installed on your platform.

这篇关于CMake的:FIND_PACKAGE(线程)为Android交叉编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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