File tree Expand file tree Collapse file tree 3 files changed +52
-0
lines changed
docs/+current/modules/debug Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ ### Added
11+
12+ * ` var_dump_all() ` macro in ` debug.cmake ` .
13+
1014### Changed
1115
1216* Reformatted release (_ version_ ) headings in ` CHANGELOG.md ` .
Original file line number Diff line number Diff line change @@ -204,6 +204,24 @@ if (NOT COMMAND "var_dump")
204204 endfunction ()
205205endif ()
206206
207+ if (NOT COMMAND "var_dump_all" )
208+
209+ #! var_dump_all : Outputs human-readable information about CMake's current defined variables
210+ #
211+ # @see https://cmake.org/cmake/help/latest/prop_dir/VARIABLES.html#variables
212+ #
213+ macro (var_dump_all)
214+ # Get the global VARIABLES
215+ # @see https://cmake.org/cmake/help/latest/prop_dir/VARIABLES.html#variables
216+ get_cmake_property (_global_vars VARIABLES )
217+ list (SORT _global_vars)
218+
219+ foreach (_var "${_global_vars} " )
220+ var_dump(PROPERTIES ${_var} )
221+ endforeach ()
222+ endmacro ()
223+ endif ()
224+
207225if (NOT COMMAND "build_info" )
208226
209227 #! build_info : Output build information to stdout or stderr (Cmake's message type specific)
Original file line number Diff line number Diff line change @@ -196,4 +196,34 @@ Outputs:
196196
197197``` txt
198198my_list = (string 15) "foo;bar;42;true"
199+ ```
200+
201+ ## ` var_dump_all() `
202+
203+ ** Available Since: ` v0.2.0 ` **
204+
205+ Outputs human-readable information about CMake's current defined variables.
206+
207+ _ See Cmake's [ ` VARIABLES ` ] ( https://cmake.org/cmake/help/latest/prop_dir/VARIABLES.html ) for additional information._
208+
209+ ``` cmake
210+ var_dump_all()
211+ ```
212+
213+ Outputs:
214+
215+ ``` txt
216+ ALERT_LEVEL = (command, cached) ALERT_LEVEL()
217+ BUILD_TESTING = (string 0) ""
218+ CMAKE_AUTOGEN_ORIGIN_DEPENDS = (string 2) "ON"
219+ CMAKE_AUTOMOC_COMPILER_PREDEFINES = (string 2) "ON"
220+ CMAKE_AUTOMOC_MACRO_NAMES = (list 4) [
221+ 0: (string 8) "Q_OBJECT"
222+ 1: (string 8) "Q_GADGET"
223+ 2: (string 11) "Q_NAMESPACE"
224+ 3: (string 18) "Q_NAMESPACE_EXPORT"
225+ ]
226+ CMAKE_AUTOMOC_PATH_PREFIX = (string 3) "OFF"
227+
228+ ... remaining not shown
199229```
You can’t perform that action at this time.
0 commit comments