1set(cmsis_pkg_name cmsis) 2 3if(ENABLE_GITEE) 4 set(REQ_URL "https://gitee.com/mirrors/CMSIS_5/repository/archive/5.7.0.tar.gz") 5 set(MD5 "feb96c10a99bd0eb54fb7ce49af8d285") 6else() 7 set(REQ_URL "https://github.com/ARM-software/CMSIS_5/archive/5.7.0.tar.gz") 8 set(MD5 "0eaa594b0c62dd72e41ec181c4689842") 9endif() 10 11set(INCLUDE "./") 12 13mindspore_add_pkg(${cmsis_pkg_name} 14 VER 5.7.0 15 HEAD_ONLY ${INCLUDE} 16 URL ${REQ_URL} 17 MD5 ${MD5}) 18 19message("micro get ${cmsis_pkg_name} config hash: ${${cmsis_pkg_name}_CONFIG_HASH}") 20 21file(GLOB cmsic_children RELATIVE ${_MS_LIB_CACHE} ${_MS_LIB_CACHE}/*) 22 23foreach(child ${cmsic_children}) 24 string(FIND "${child}" "${cmsis_pkg_name}" position) 25 if(NOT "${position}" EQUAL "-1") 26 file(STRINGS ${_MS_LIB_CACHE}/${child}/options.txt cmsis_configs) 27 foreach(cmsis_config ${cmsis_configs}) 28 string(FIND "${cmsis_config}" "${MD5}" position_md5) 29 if(NOT "${position_md5}" EQUAL "-1") 30 if(NOT IS_DIRECTORY ${CMAKE_BINARY_DIR}/${cmsis_pkg_name}) 31 MESSAGE("copy cmsis libaray: ${child} to ${CMAKE_BINARY_DIR}") 32 file(COPY ${_MS_LIB_CACHE}/${child}/CMSIS DESTINATION ${CMAKE_BINARY_DIR}/${cmsis_pkg_name}) 33 endif() 34 endif() 35 endforeach() 36 endif() 37endforeach() 38