1set(LIB_ICU_COMMON icuuc) 2set(LIB_ICU_DATA icudata) 3set(LIB_ICU_I18N icui18n) 4 5if(ENABLE_GITEE) 6 set(REQ_URL "https://gitee.com/mirrors/icu/repository/archive/release-67-1.tar.gz") 7 set(MD5 "5737b3606a06a6b5bf82b44047594d5a") 8else() 9 set(REQ_URL "https://github.com/unicode-org/icu/archive/release-67-1.tar.gz") 10 set(MD5 "fd525fb47d8827b0b7da78b51dd2d93f") 11endif() 12 13if(CMAKE_SYSTEM_NAME MATCHES "Windows") 14 message("icu4c thirdparty do not support windows currently.") 15else() 16 set(JSON_FILE "{ \n\ 17 \"strategy\": \"additive\",\n\ 18 \"featureFilters\": {\n\ 19 \"normalization\": \"include\"\n\ 20 }\n\ 21}\ 22 ") 23 file(WRITE ${CMAKE_BINARY_DIR}/icu4c_filter.json ${JSON_FILE}) 24 if(CMAKE_SYSTEM_NAME MATCHES "Darwin") 25 mindspore_add_pkg(icu4c 26 VER 67.1 27 LIBS ${LIB_ICU_COMMON} ${LIB_ICU_DATA} ${LIB_ICU_I18N} 28 URL ${REQ_URL} 29 MD5 ${MD5} 30 PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/icu4c/icu4c.patch01 31 CONFIGURE_COMMAND ./icu4c/source/runConfigureICU MacOSX --enable-rpath --disable-tests 32 --disable-samples --disable-icuio --disable-extras 33 ICU_DATA_FILTER_FILE=${CMAKE_BINARY_DIR}/icu4c_filter.json 34 ) 35 else() 36 mindspore_add_pkg(icu4c 37 VER 67.1 38 LIBS ${LIB_ICU_COMMON} ${LIB_ICU_DATA} ${LIB_ICU_I18N} 39 URL ${REQ_URL} 40 MD5 ${MD5} 41 PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/icu4c/icu4c.patch01 42 CONFIGURE_COMMAND ./icu4c/source/runConfigureICU Linux --enable-rpath --disable-tests --disable-samples 43 --disable-icuio --disable-extras 44 ICU_DATA_FILTER_FILE=${CMAKE_BINARY_DIR}/icu4c_filter.json 45 ) 46 endif() 47 include_directories(${icu4c_INC}) 48 add_library(mindspore::icuuc ALIAS icu4c::${LIB_ICU_COMMON}) 49 add_library(mindspore::icudata ALIAS icu4c::${LIB_ICU_DATA}) 50 add_library(mindspore::icui18n ALIAS icu4c::${LIB_ICU_I18N}) 51 add_definitions(-D ENABLE_ICU4C) 52endif() 53