1set(cmsis_pkg_name cmsis) 2 3if(ENABLE_GITEE OR ENABLE_GITEE_EULER) # Channel GITEE_EULER is NOT supported now, use GITEE instead. 4 set(REQ_URL "https://gitee.com/mirrors/CMSIS_5/repository/archive/5.7.0.tar.gz") 5 set(SHA256 "1b4aa6d47c7d3a5032555049b95f4962a700e2022405f863781010606fe7f8f1") 6else() 7 set(REQ_URL "https://github.com/ARM-software/CMSIS_5/archive/5.7.0.tar.gz") 8 set(SHA256 "1b4aa6d47c7d3a5032555049b95f4962a700e2022405f863781010606fe7f8f1") 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 SHA256 ${SHA256}) 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}" "${SHA256}" position_sha256) 29 if(NOT "${position_sha256}" 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