-
Notifications
You must be signed in to change notification settings - Fork 650
/
Copy pathDebugUtils.cmake
41 lines (36 loc) · 1.01 KB
/
DebugUtils.cmake
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
function(DumpVariables)
set(options MARK HCF)
set(oneValueArgs)
set(multiValueArgs VARS)
cmake_parse_arguments(DumpVariables
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN})
get_cmake_property(_CMAKE_VARIABLES VARIABLES)
set(MARK ${DumpVariables_MARK})
set(HCF ${DumpVariables_HCF})
if(DumpVariables_VARS)
set(VARS "${DumpVariables_VARS}")
else()
set(VARS ${_CMAKE_VARIABLES})
endif()
if(MARK)
message("")
message("#####################")
message("DumpVariables - BEGIN")
endif()
foreach(_CMAKE_VARIABLE ${_CMAKE_VARIABLES})
if(_CMAKE_VARIABLE IN_LIST VARS)
message(STATUS "${_CMAKE_VARIABLE}=${${_CMAKE_VARIABLE}}")
endif()
endforeach(_CMAKE_VARIABLE)
if(MARK)
message("DumpVariables - END")
message("#####################")
message("")
endif()
if(HCF)
message(FATAL_ERROR "HCF - DumpVariables")
endif()
endfunction(DumpVariables)