18 lines
526 B
CMake
Raw Normal View History

2019-11-11 23:01:05 +01:00
function(create_gcov_file gcda_full_path)
get_filename_component(gcda_name ${gcda_full_path} NAME)
string(REPLACE ".gcda" ".gcov" gcov_name "${gcda_name}")
file(STRINGS "${gcda_full_path}" source_file LIMIT_COUNT 1 ENCODING UTF-8)
file(WRITE "${CMAKE_SOURCE_DIR}/${gcov_name}"
" -: 0:Source:${source_file}"
)
endfunction()
2015-04-27 22:25:09 +02:00
foreach(I RANGE 0 ${CMAKE_ARGC})
if("${CMAKE_ARGV${I}}" MATCHES ".*\\.gcda")
set(gcda_file "${CMAKE_ARGV${I}}")
2019-11-11 23:01:05 +01:00
create_gcov_file(${gcda_file})
2015-04-27 22:25:09 +02:00
endif()
endforeach()