Fork from inav at github. Modified for some special functions needs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
655 B

  1. function(setup_svd target_exe target_name)
  2. get_property(svd_name TARGET ${target_exe} PROPERTY SVD)
  3. set(svd_target_name "svd_${target_name}")
  4. if (svd_name AND NOT svd_name STREQUAL "")
  5. add_custom_target(${svd_target_name}
  6. COMMAND ${CMAKE_COMMAND} -E copy
  7. ${SVD_DIR}/${svd_name}.svd
  8. ${CMAKE_BINARY_DIR}/svd/${target_name}.svd
  9. )
  10. else()
  11. add_custom_target(${svd_target_name}
  12. ${CMAKE_COMMAND} -E echo "target ${target_name} does not declare an SVD filename"
  13. COMMAND ${CMAKE_COMMAND} -E false)
  14. endif()
  15. exclude_from_all(${svd_target_name})
  16. endfunction()