Only search for iconv library if iconv.h was found

Peter Wortmann 2010-02-09 19:21:00 +01:00
parent 0335b9133a
commit d196565fea
1 changed files with 7 additions and 5 deletions

View File

@ -603,12 +603,14 @@ endif()
include(CheckFunctionExists)
CHECK_FUNCTION_EXISTS(vasprintf HAVE_VASPRINTF)
CHECK_FUNCTION_EXISTS(iconv HAVE_ICONV_WO_LINK)
mark_as_advanced(HAVE_ICONV_WO_LINK)
if(HAVE_ICONV)
CHECK_FUNCTION_EXISTS(iconv HAVE_ICONV_WO_LINK)
mark_as_advanced(HAVE_ICONV_WO_LINK)
if(NOT HAVE_ICONV_WO_LINK)
FIND_LIBRARY( ICONV_LIBRARY NAMES iconv )
MARK_AS_ADVANCED( ICONV_LIBRARY )
if(NOT HAVE_ICONV_WO_LINK)
FIND_LIBRARY( ICONV_LIBRARY NAMES iconv )
MARK_AS_ADVANCED( ICONV_LIBRARY )
endif()
endif()
############################################################################