File tree 3 files changed +49
-1
lines changed
3 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,11 @@ endif(ENABLE_LOGGING)
63
63
64
64
find_package (Threads)
65
65
66
+ find_package (Iconv)
67
+ if (ICONV_FOUND)
68
+ include_directories (${ICONV_INCLUDE_DIRS} )
69
+ endif (ICONV_FOUND)
70
+
66
71
if (BUILD_TEST)
67
72
find_package (GTest REQUIRED)
68
73
if (GTEST_FOUND)
Original file line number Diff line number Diff line change
1
+ # Find iconv library
2
+ #
3
+ # Author: Eddy Xu <eddyxu at gmail.com>
4
+ #
5
+ # Released under BSD license
6
+ #
7
+ # ICONV_INCLUDE_DIRS - where to find iconv.h, etc
8
+ # ICONV_LIBRARIES - Lists of libraries when using iconv
9
+ # ICONV_FOUND - True if iconv found
10
+
11
+
12
+ # Look for the header file
13
+ FIND_PATH ( ICONV_INCLUDE_DIR NAMES iconv.h )
14
+ MARK_AS_ADVANCED ( ICONV_INCLUDE_DIR )
15
+
16
+ # Look for the library
17
+ FIND_LIBRARY ( ICONV_LIBRARY NAMES iconv )
18
+ MARK_AS_ADVANCED ( ICONV_LIBRARY )
19
+
20
+ # Copy the result to output variables
21
+ IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY)
22
+ SET (ICONV_FOUND 1)
23
+ SET (ICONV_LIBRARIES ${ICONV_LIBRARY} )
24
+ SET (ICONV_INCLUDE_DIRS ${ICONV_INCLUDE_DIR} )
25
+ ELSE (ICONV_INCLUDE_DIR AND ICONV_LIBRARY)
26
+ SET (ICONV_FOUND 0)
27
+ SET (ICONV_LIBRARIES)
28
+ SET (ICONV_INCLUDE_DIRS)
29
+ ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY)
30
+
31
+ # Report results
32
+ IF (NOT ICONV_FOUND)
33
+ SET (ICONV_DIR_MESSAGE
34
+ "Iconv was not found. Make sure ICONV_LIBRARY and ICONV_INCLUDE_DIR are
35
+ set." )
36
+ IF (NOT ICONV_FIND_QUIETLY)
37
+ MESSAGE (STATUS ${ICONV_DIR_MESSAGE} )
38
+ ELSE (NOT ICONV_FIND_QUIETLY)
39
+ IF (ICONV_FIND_REQUIRED)
40
+ MESSAGE (FETAL_ERROR ${ICONV_DIR_MESSAGE} )
41
+ ENDIF (ICONV_FIND_REQUIRED)
42
+ ENDIF (NOT ICONV_FIND_QUIETLY)
43
+ ENDIF (NOT ICONV_FOUND)
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ if(Gflags_FOUND)
19
19
endif (Gflags_FOUND)
20
20
21
21
set (RIME_CORE_DEPS ${Boost_LIBRARIES} ${Glog_LIBRARY} ${YamlCpp_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${RIME_OPTIONAL_DEPS} )
22
- set (RIME_EXTRA_DEPS ${LevelDb_LIBRARY} ${Marisa_LIBRARY} ${Opencc_LIBRARY} )
22
+ set (RIME_EXTRA_DEPS ${ICONV_LIBRARIES} ${ LevelDb_LIBRARY} ${Marisa_LIBRARY} ${Opencc_LIBRARY} )
23
23
24
24
if (BUILD_SEPARATE_LIBS)
25
25
set (RIME_DEPS ${RIME_CORE_DEPS} )
You can’t perform that action at this time.
0 commit comments