# ExternalProject\_Add + autotools

**URL:** <https://discourse.cmake.org/t/externalproject-add-autotools/14475>\
**Category:** Code\
**Created:** [July 31, 2025, 12:56am UTC](https://discourse.cmake.org/t/externalproject-add-autotools/14475 "2025-07-31T00:56:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![moi15moi](https://discourse.cmake.org/user_avatar/discourse.cmake.org/moi15moi/32/5605_2.png) [@moi15moi](https://discourse.cmake.org/u/moi15moi)\
**Post date:** [July 31, 2025, 12:56am UTC](https://discourse.cmake.org/t/externalproject-add-autotools/14475/1 "2025-07-31T00:56:56Z")

</div>

I have this [CMakeLists.txt](https://github.com/peerless2012/libass-android/blob/a42280389145de4c7fd979cf0101520914636e4a/lib_ass/src/main/cpp/CMakeLists.txt) file. The goal of this CMakeLists.txt is simply to have a shared library that contain all libass dependencies.

To do so, we use libass-cmake. It build libass and it’s dependencies. Here is how we build libass which use autotools: [libass-cmake/cmake/ass.cmake at 68729805da3fa71ae566bd350b336d7b683b4c83 · peerless2012/libass-cmake · GitHub](https://github.com/peerless2012/libass-cmake/blob/68729805da3fa71ae566bd350b336d7b683b4c83/cmake/ass.cmake)

In the CMakeLists.txt, we have 3 hacks:

1. We copied libass header in our project
2. We need to specify all libass dependencies manually in `target_link_libraries`.
3. We created a empty file (`Ass.c`), so we can create our shared library:

I wanted to use `pkg_search_module`, but the problem is that is look for the .pc file before we actually build libass in libass-cmake, so it seems we cannot use it.

How can i remove the hacks we have in our project?
