Skip to content

Commit

Permalink
fixed non-stable iconv search
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey N. Vinogradov authored and klirichek committed Nov 12, 2017
1 parent 81ac25a commit d043f7e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cmake/FindICONV.cmake
Expand Up @@ -44,15 +44,16 @@ CHECK_CXX_SOURCE_COMPILES ( "${_CHECK_ICONVC}" HAVE_LIBICONV )

if ( NOT HAVE_LIBICONV )
foreach ( LIB iconv libiconv )
UNSET ( _LIB_PATH CACHE )
find_library ( _LIB_PATH NAMES ${LIB} )
SET ( CMAKE_REQUIRED_LIBRARIES "${_LIB_PATH}")
UNSET ( LIBICONV_LIBRARY CACHE )
find_library ( LIBICONV_LIBRARY NAMES ${LIB} )
SET ( CMAKE_REQUIRED_LIBRARIES "${LIBICONV_LIBRARY}")
UNSET ( HAVE_LIBICONV CACHE )
CHECK_CXX_SOURCE_COMPILES ( "${_CHECK_ICONVC}" HAVE_LIBICONV )
if ( HAVE_LIBICONV )
message ( STATUS "iconv found as is ${_LIB_PATH}" )
set ( LIBICONV_LIBRARY "${_LIB_PATH}" )
message ( STATUS "iconv found as is ${LIBICONV_LIBRARY}" )
break ()
else()
UNSET ( LIBICONV_LIBRARY CACHE )
endif ()
endforeach ( LIB )
endif ()
Expand Down

0 comments on commit d043f7e

Please sign in to comment.