Browse Source

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.
Peter Kokot 9 months ago
parent
commit
d9de3fe322
1 changed files with 15 additions and 1 deletions
  1. 15 1
      Help/command/cmake_host_system_information.rst

+ 15 - 1
Help/command/cmake_host_system_information.rst

@@ -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