File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -373,6 +373,7 @@ else ( WIN32 )
373
373
if ( WITH_EXPAT )
374
374
option_menu ( ICONV "compile with iconv support" USE_LIBICONV EXTRA_LIBRARIES )
375
375
mark_as_advanced ( WITH_ICONV )
376
+ memcfgvalues ( USE_LIBICONV )
376
377
endif ( WITH_EXPAT )
377
378
378
379
# test for MYSQL
Original file line number Diff line number Diff line change 28
28
find_path ( ICONV_INCLUDE_DIRS iconv.h )
29
29
30
30
include ( helpers )
31
- ac_search_libs ( "iconv;libiconv" "iconv" HAVE_LIBICONV LIBICONV_LIBRARY )
31
+
32
+ set ( _CHECK_ICONVC "
33
+ #include <iconv.h>
34
+ #include <stdio.h>
35
+ int main()
36
+ {
37
+ iconv_t pDesc = iconv_open ( \" UTF-16\" , \" UTF-8\" );
38
+ }" )
39
+
40
+
41
+ get_property ( dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES )
42
+ SET (CMAKE_REQUIRED_INCLUDES "${dirs} " )
43
+ CHECK_CXX_SOURCE_COMPILES ( "${_CHECK_ICONVC} " HAVE_LIBICONV )
44
+
45
+ if ( NOT HAVE_LIBICONV )
46
+ foreach ( LIB iconv libiconv )
47
+ UNSET ( _LIB_PATH CACHE )
48
+ find_library ( _LIB_PATH NAMES ${LIB} )
49
+ SET ( CMAKE_REQUIRED_LIBRARIES "${_LIB_PATH} " )
50
+ UNSET ( HAVE_LIBICONV CACHE )
51
+ CHECK_CXX_SOURCE_COMPILES ( "${_CHECK_ICONVC} " HAVE_LIBICONV )
52
+ if ( HAVE_LIBICONV )
53
+ message ( STATUS "iconv found as is ${_LIB_PATH} " )
54
+ set ( LIBICONV_LIBRARY "${_LIB_PATH} " )
55
+ break ()
56
+ endif ()
57
+ endforeach ( LIB )
58
+ endif ()
59
+
60
+ mark_as_advanced (_LIB_PATH )
32
61
33
62
if ( HAVE_LIBICONV )
34
63
set ( _CHECK_ICONV "#include <iconv.h>
35
- #include <stdio.h>
64
+ #include <stdio.h>
36
65
37
66
int main()
38
67
{
You can’t perform that action at this time.
0 commit comments