File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ endif()
73
73
74
74
include (cmake/OpenCVUtils.cmake )
75
75
76
+ ocv_cmake_eval (DEBUG_PRE ONCE )
77
+
76
78
ocv_clear_vars (OpenCVModules_TARGETS )
77
79
78
80
# ----------------------------------------------------------------------------
@@ -1107,3 +1109,7 @@ endif()
1107
1109
# ----------------------------------------------------------------------------
1108
1110
1109
1111
include (cmake/OpenCVPackaging.cmake )
1112
+
1113
+ # This should be the last command
1114
+ ocv_cmake_dump_vars ("" TOFILE "CMakeVars.txt" )
1115
+ ocv_cmake_eval (DEBUG_POST ONCE )
Original file line number Diff line number Diff line change @@ -11,6 +11,47 @@ if(NOT COMMAND find_host_program)
11
11
endmacro ()
12
12
endif ()
13
13
14
+ if (NOT COMMAND cmake_parse_arguments )
15
+ include (CMakeParseArguments OPTIONAL ) # CMake 2.8.3+
16
+ endif ()
17
+
18
+ # Debugging function
19
+ function (ocv_cmake_dump_vars )
20
+ set (VARS "" )
21
+ get_cmake_property (_variableNames VARIABLES )
22
+ if (COMMAND cmake_parse_arguments222 )
23
+ cmake_parse_arguments (DUMP "" "TOFILE" "" ${ARGN} )
24
+ set (regex "${DUMP_UNPARSED_ARGUMENTS} " )
25
+ else ()
26
+ set (regex "${ARGV0} " )
27
+ if (ARGV1 STREQUAL "TOFILE" )
28
+ set (DUMP_TOFILE "${ARGV2} " )
29
+ endif ()
30
+ endif ()
31
+ string (TOLOWER "${regex} " regex_lower )
32
+ foreach (_variableName ${_variableNames} )
33
+ string (TOLOWER "${_variableName} " _variableName_lower )
34
+ if (_variableName MATCHES "${regex} " OR _variableName_lower MATCHES "${regex_lower} " )
35
+ set (VARS "${VARS}${_variableName} =${${_variableName} }\n " )
36
+ endif ()
37
+ endforeach ()
38
+ if (DUMP_TOFILE )
39
+ file (WRITE ${CMAKE_BINARY_DIR} /${DUMP_TOFILE} "${VARS} " )
40
+ else ()
41
+ message (AUTHOR_WARNING "${VARS} " )
42
+ endif ()
43
+ endfunction ()
44
+
45
+ function (ocv_cmake_eval var_name )
46
+ if (DEFINED ${var_name} )
47
+ file (WRITE "${CMAKE_BINARY_DIR} /CMakeCommand-${var_name} .cmake" ${${var_name}} )
48
+ include ("${CMAKE_BINARY_DIR} /CMakeCommand-${var_name} .cmake" )
49
+ endif ()
50
+ if (";${ARGN} ;" MATCHES ";ONCE;" )
51
+ unset (${var_name} CACHE )
52
+ endif ()
53
+ endfunction ()
54
+
14
55
# assert macro
15
56
# Note: it doesn't support lists in arguments
16
57
# Usage samples:
You can’t perform that action at this time.
0 commit comments