File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,19 @@ IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
1212ENDIF ()
1313
1414FIND_PATH (ICONV_INCLUDE_DIR iconv.h)
15+ CHECK_FUNCTION_EXISTS(iconv_open libc_has_iconv)
1516FIND_LIBRARY (iconv_lib NAMES iconv libiconv libiconv-2 c)
1617
17- IF (ICONV_INCLUDE_DIR AND iconv_lib)
18- SET (ICONV_FOUND TRUE )
19- ENDIF ()
20-
21- IF (ICONV_FOUND)
22- # split iconv into -L and -l linker options, so we can set them for pkg-config
18+ IF (ICONV_INCLUDE_DIR AND libc_has_iconv)
19+ SET (ICONV_FOUND TRUE )
20+ SET (ICONV_LIBRARIES "" )
21+ IF (NOT ICONV_FIND_QUIETLY)
22+ MESSAGE (STATUS "Found Iconv: provided by libc" )
23+ ENDIF (NOT ICONV_FIND_QUIETLY)
24+ ELSEIF (ICONV_INCLUDE_DIR AND iconv_lib)
25+ SET (ICONV_FOUND TRUE )
26+ # split iconv into -L and -l linker options, so we can
27+ # set them for pkg-config
2328 GET_FILENAME_COMPONENT (iconv_path ${iconv_lib} PATH )
2429 GET_FILENAME_COMPONENT (iconv_name ${iconv_lib} NAME_WE )
2530 STRING (REGEX REPLACE "^lib" "" iconv_name ${iconv_name} )
You can’t perform that action at this time.
0 commit comments