From 09a218053d381cf86e7bcbb899674778bc2f96d6 Mon Sep 17 00:00:00 2001 From: alin Date: Tue, 18 Mar 2025 13:40:55 +0100 Subject: [PATCH 1/3] Add var_dump_all() macro --- cmake/rsp/debug.cmake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cmake/rsp/debug.cmake b/cmake/rsp/debug.cmake index e751af0..af5c320 100644 --- a/cmake/rsp/debug.cmake +++ b/cmake/rsp/debug.cmake @@ -204,6 +204,24 @@ if (NOT COMMAND "var_dump") endfunction() endif () +if (NOT COMMAND "var_dump_all") + + #! var_dump_all : Outputs human-readable information about CMake's current defined variables + # + # @see https://cmake.org/cmake/help/latest/prop_dir/VARIABLES.html#variables + # + macro(var_dump_all) + # Get the global VARIABLES + # @see https://cmake.org/cmake/help/latest/prop_dir/VARIABLES.html#variables + get_cmake_property(_global_vars VARIABLES) + list (SORT _global_vars) + + foreach (_var "${_global_vars}") + var_dump(PROPERTIES ${_var}) + endforeach() + endmacro() +endif () + if(NOT COMMAND "build_info") #! build_info : Output build information to stdout or stderr (Cmake's message type specific) From 8255772e1858c070db77d27b7f837d21d7661d6f Mon Sep 17 00:00:00 2001 From: alin Date: Tue, 18 Mar 2025 13:46:35 +0100 Subject: [PATCH 2/3] Add doc for var_dump_all() --- docs/+current/modules/debug/dump.md | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/+current/modules/debug/dump.md b/docs/+current/modules/debug/dump.md index c29ae0b..a700859 100644 --- a/docs/+current/modules/debug/dump.md +++ b/docs/+current/modules/debug/dump.md @@ -196,4 +196,34 @@ Outputs: ```txt my_list = (string 15) "foo;bar;42;true" +``` + +## `var_dump_all()` + +**Available Since: `v0.2.0`** + +Outputs human-readable information about CMake's current defined variables. + +_See Cmake's [`VARIABLES`](https://cmake.org/cmake/help/latest/prop_dir/VARIABLES.html) for additional information._ + +```cmake +var_dump_all() +``` + +Outputs: + +```txt +ALERT_LEVEL = (command, cached) ALERT_LEVEL() +BUILD_TESTING = (string 0) "" +CMAKE_AUTOGEN_ORIGIN_DEPENDS = (string 2) "ON" +CMAKE_AUTOMOC_COMPILER_PREDEFINES = (string 2) "ON" +CMAKE_AUTOMOC_MACRO_NAMES = (list 4) [ + 0: (string 8) "Q_OBJECT" + 1: (string 8) "Q_GADGET" + 2: (string 11) "Q_NAMESPACE" + 3: (string 18) "Q_NAMESPACE_EXPORT" +] +CMAKE_AUTOMOC_PATH_PREFIX = (string 3) "OFF" + +... remaining not shown ``` \ No newline at end of file From 334399d1d3c2b92ceb51847fa0e206c1e01c804f Mon Sep 17 00:00:00 2001 From: alin Date: Tue, 18 Mar 2025 13:47:08 +0100 Subject: [PATCH 3/3] Change release notes --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb7bfd5..e7c5bf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +* `var_dump_all()` macro in `debug.cmake`. + ### Changed * Reformatted release (_version_) headings in `CHANGELOG.md`.