You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

cmsis.cmake 1.3 kB

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