fakegcov.cmake 413 B

1234567891011121314
  1. foreach(I RANGE 0 ${CMAKE_ARGC})
  2. if("${CMAKE_ARGV${I}}" MATCHES ".*\\.gcda")
  3. set(gcda_file "${CMAKE_ARGV${I}}")
  4. endif()
  5. endforeach()
  6. get_filename_component(gcda_name ${gcda_file} NAME)
  7. string(REPLACE ".gcda" ".gcov" gcov_name "${gcda_name}")
  8. file(STRINGS "${gcda_file}" source_file LIMIT_COUNT 1 ENCODING UTF-8)
  9. file(WRITE "${CMAKE_SOURCE_DIR}/${gcov_name}"
  10. " -: 0:Source:${source_file}"
  11. )