CMake: FIND_PACKAGE (Threads) for cross-compiling Android

I use Android NDK and Cmake to create shared libraries for my project.

I am migrating an existing project from Ubuntu to Android, and now I need to migrate some executable files. I will compile the entire sexecpt executable that needs the Threads library.

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

I followed this cmake and libpthread , but without success.

It seems to me that I should write a FindThread.cmake file, but I'm pretty new to CMake and donโ€™t know how to do this, especially since I donโ€™t know where the thread library for Android is.

Any help would be greatly appreciated. thank you

+3
source share
1 answer

You do not need to write your own FindThread.cmake. In a standard linux installation, it can be found in / usr / share / cmake -2.8 / Modules /.

Check where this module / directory can be installed on your platform.

0
source

Source: https://habr.com/ru/post/1384722/


All Articles