Skip to content

Deal with Qt's CMake code modifying CMAKE_SHARED_LIBRARY_SUFFIX

Qt adds the Android ABI to the suffix there unconditionally, without also adjusting CMAKE_FIND_LIBRARY_SUFFIXES accordingly, breaking find_library() for things built that way. Unfortunately we can't just set this in our toolchain file, as CMAKE_FIND_LIBRARY_SUFFIXES is overwritten by CMake after evaluating the toolchain file. So we need to use the variable_watch hack for this here, thanks to Aleix for the idea.

With this, find_library() works for both suffixed and un-suffixed libraries again, such as Poppler built with or without Qt support.

Merge request reports