diff --git a/development/cmake/modules/FindICONV.cmake b/development/cmake/modules/FindICONV.cmake index 06e4f43949..bd3a49ad68 100644 --- a/development/cmake/modules/FindICONV.cmake +++ b/development/cmake/modules/FindICONV.cmake @@ -66,14 +66,21 @@ if(WIN32) MESSAGE(FATAL_ERROR "exit cmake") ENDIF(NOT ICONV_DLL AND ICONV_DLL_HELP) ENDIF(ICONV_FIND_REQUIRED) + IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY AND ICONV_DLL) + SET(ICONV_FOUND TRUE) + ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY AND ICONV_DLL) ELSE(WIN32) - set(ICONV_DLL TRUE) + check_function_exists(iconv HAVE_ICONV_IN_LIBC) + IF (ICONV_INCLUDE_DIR AND HAVE_ICONV_IN_LIBC) + SET(ICONV_FOUND TRUE) + SET(ICONV_LIBRARY CACHE TYPE STRING FORCE) + ENDIF (ICONV_INCLUDE_DIR AND HAVE_ICONV_IN_LIBC) + IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY) + SET(ICONV_FOUND TRUE) + ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY) endif(WIN32) -IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY AND ICONV_DLL) - SET(ICONV_FOUND TRUE) -ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY AND ICONV_DLL) IF (ICONV_FOUND) IF (NOT ICONV_FIND_QUIETLY)