-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeReport.cmake
More file actions
77 lines (53 loc) · 1.58 KB
/
Copy pathCMakeReport.cmake
File metadata and controls
77 lines (53 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
cmake_minimum_required(VERSION 2.6)
message("CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
file(GLOB_RECURSE info_files *.info)
set(target_list "")
foreach(loop_var ${info_files})
string(REGEX MATCH /test01.info mtc ${loop_var})
string(LENGTH "${mtc}" len)
string(REGEX MATCH /test.info mtc2 ${loop_var})
string(LENGTH "${mtc2}" len2)
if(${len} EQUAL 0 AND ${len2} EQUAL 0)
list(APPEND target_list "${loop_var}")
else()
# message("#### removed ${loop_var}")
endif()
endforeach()
list(GET target_list 0 file1)
list(GET target_list 1 file2)
list(REMOVE_AT target_list 0 1)
message("COMMAND lcov -a ${file1} -a ${file2} -o test01.info")
execute_process(
COMMAND lcov -a ${file1} -a ${file2} -o test01.info
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
OUTPUT_QUIET
)
execute_process(
COMMAND cp test01.info test.info
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
foreach(loop_var ${target_list})
execute_process(
COMMAND lcov -a test.info -a ${loop_var} -o test.info
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
endforeach()
execute_process(
COMMAND cp test.info test01.info
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
#foreach(loop_var ${target_list})
# execute_process(
# COMMAND cp test01.info test.info
# COMMAND lcov -a test.info -a ${loop_var} -o test01.info
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
# OUTPUT_QUIET
# )
#endforeach()
message("execute_last_process")
execute_process(
COMMAND lcov --remove test01.info "/usr/include/*" "*/src_test/*" "*/src_gen/*" -o test.info
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
OUTPUT_QUIET
)
# message("############## end of CmakeReport.cmake")