FindIconv: Fix finding iconv.h on Alpine Linux

Alpine Linux has the `iconv.h` belonging to the builtin `iconv` library
provided by musl C library in the standard directory (`/usr/include`).
However, when installing the GNU libiconv APK package (`gnu-libiconv`),
the GNU `libiconv` library has header located in
`/usr/include/gnu-libiconv` subdirectory.  Fix finding the header
matching the `libiconv` library.

Issue: #24695
This commit is contained in:
Peter Kokot
2024-08-25 01:38:04 +02:00
committed by Brad King
parent 86f2af6173
commit c9f6369c76

View File

@@ -134,6 +134,8 @@ else()
find_path(Iconv_INCLUDE_DIR
NAMES "iconv.h"
PATH_SUFFIXES
gnu-libiconv # GNU libiconv on Alpine Linux has header in a subdirectory.
DOC "iconv include directory")
set(Iconv_LIBRARY_NAMES "iconv" "libiconv")
mark_as_advanced(Iconv_INCLUDE_DIR)