cmake_host_system_information: Extend fallback script example

This fixes some typos and extends example how to use the
CMAKE_GET_OS_RELEASE_FALLBACK_SCRIPTS list variable.
This commit is contained in:
Peter Kokot 2025-02-28 23:22:24 +01:00
parent f9b8eeec2f
commit d9de3fe322
No known key found for this signature in database
GPG Key ID: A94800907AA79B36

View File

@ -214,7 +214,7 @@ Fallback Interface Variables
.. variable:: CMAKE_GET_OS_RELEASE_FALLBACK_SCRIPTS
In addition to the scripts shipped with CMake, a user may append full
paths to his script(s) to the this list. The script filename has the
paths of their script(s) to this list. The script filename has the
following format: ``NNN-<name>.cmake``, where ``NNN`` is three digits
used to apply collected scripts in a specific order.
@ -234,6 +234,8 @@ Example:
.. code-block:: cmake
# 000-FallbackScript.cmake
#
# Try to detect some old distribution
# See also
# - http://linuxmafia.com/faq/Admin/release-files.html
@ -268,6 +270,18 @@ Example:
endif()
unset(CMAKE_GET_OS_RELEASE_FALLBACK_CONTENT)
Then this script can be applied as a fallback to determine the missing host
system information:
.. code-block:: cmake
list(
APPEND
CMAKE_GET_OS_RELEASE_FALLBACK_SCRIPTS
${CMAKE_CURRENT_SOURCE_DIR}/000-FallbackScript.cmake
)
cmake_host_system_information(RESULT info QUERY DISTRIB_INFO)
.. rubric:: Footnotes