# How add .so lib on Qt for Android using CMake

**URL:** https://discourse.cmake.org/t/how-add-so-lib-on-qt-for-android-using-cmake/2224
**Category:** Code
**Created:** [November 23, 2020, 5:20pm UTC](https://discourse.cmake.org/t/how-add-so-lib-on-qt-for-android-using-cmake/2224 "2020-11-23T17:20:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![software.dev992](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/5e9695/32.png) [@software.dev992](https://discourse.cmake.org/u/software.dev992)
#### Post date: [November 23, 2020, 5:20pm UTC](https://discourse.cmake.org/t/how-add-so-lib-on-qt-for-android-using-cmake/2224/1 "2020-11-23T17:20:05Z")

</div>

Hi,  
I have a project that I build for android using Qt 5.12.9. This project uses CMake 3.16.2 and of course androiddeployqt. I don’t see any gradle script in my project tree so I think that is all automated by androiddeployqt.  
I added a .so library using CMake to my project: after the addition the projects builds correctly without errors but I noticed a runtime error regarding the .so library mentioned above: then I unpacked the .apk file and discovered that the .so library in discussion is not placed in the libs folder of the apk, then at runtime the application raises an exception.  
Can you suggest me how I can instruct CMake or to place a specific .so library (which is already used for the build process by CMake) inside the libs folder of the apk?

Thanks

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [November 25, 2020, 5:24pm UTC](https://discourse.cmake.org/t/how-add-so-lib-on-qt-for-android-using-cmake/2224/2 "2020-11-25T17:24:53Z")

</div>

Cc: @brad.king @kyle.edwards

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [November 25, 2020, 5:37pm UTC](https://discourse.cmake.org/t/how-add-so-lib-on-qt-for-android-using-cmake/2224/3 "2020-11-25T17:37:26Z")

</div>

I don’t think CMake models the concept of an `.apk`.

The location of a `.so` file in the build tree can be controlled by the [LIBRARY\_OUTPUT\_DIRECTORY](https://cmake.org/cmake/help/v3.19/prop_tgt/LIBRARY_OUTPUT_DIRECTORY.html) target property.
