From 3dcc4db1ae3cd5ab8428b2d321bd59ab9ed86ff1 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Thu, 15 May 2025 06:56:00 +0200 Subject: [PATCH] CMakePrintHelpers: Extend documentation - Added intro code block showing how to include this module. - Used "commands" instead of "functions". - Reworded descriptions a bit. --- Modules/CMakePrintHelpers.cmake | 42 +++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/Modules/CMakePrintHelpers.cmake b/Modules/CMakePrintHelpers.cmake index 98555aaf98..4025dc3b7e 100644 --- a/Modules/CMakePrintHelpers.cmake +++ b/Modules/CMakePrintHelpers.cmake @@ -5,35 +5,47 @@ CMakePrintHelpers ----------------- -Convenience functions for printing properties and variables, useful -e.g. for debugging. +This module provides convenience commands, primarily intended for debugging, +to print the values of properties and variables. + +Load this module in CMake with: + +.. code-block:: cmake + + include(CMakePrintHelpers) Commands ^^^^^^^^ +This module provides the following commands: + .. command:: cmake_print_properties + Prints the values of properties for the specified targets, source files, + directories, tests, or cache entries: + .. code-block:: cmake - cmake_print_properties( ...] | - SOURCES [ ...] | - DIRECTORIES [ ...] | - TESTS [ ...] | - CACHE_ENTRIES [ ...] > - PROPERTIES [ ...]) + cmake_print_properties( + ...] | + SOURCES [...] | + DIRECTORIES [...] | + TESTS [...] | + CACHE_ENTRIES [...] > + PROPERTIES [...] + ) - This function prints the values of the properties of the given targets, - source files, directories, tests or cache entries. Exactly one of the - scope keywords must be used. The scope keyword and its arguments must - come before the ``PROPERTIES`` keyword in the arguments list. + Exactly one of the scope keywords must be specified. The scope keyword + and its arguments must appear before the ``PROPERTIES`` keyword in the + argument list. .. command:: cmake_print_variables + Prints each variable name followed by its value: + .. code-block:: cmake - cmake_print_variables([var1 [var2 ... [varN]]]) - - This function prints the name of each variable followed by its value. + cmake_print_variables([...]) Examples ^^^^^^^^