Update pwm_mapping.h
[inav.git] / cmake / svd.cmake
blobd6d7fb80a32a98eda886eacc231a562403a3772f
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()