From b0d503ddaa732891c6886d1236efe5cf3959028e Mon Sep 17 00:00:00 2001
From: Mathieu Westphal <mathieu.westphal@kitware.com>
Date: Tue, 1 Aug 2023 10:48:24 +0200
Subject: [PATCH] Improve SPDX documentation

---
 CMakeLists.txt                               |  2 +-
 Documentation/docs/api/cmake/ModuleSystem.md | 13 ++++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c9d3c87781..be856885c78 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -210,7 +210,7 @@ mark_as_advanced(VTK_ENABLE_CATALYST)
 #-----------------------------------------------------------------------------
 # Add an option to enable/disable SPDX generation
 # Remove the "Experimental" once https://gitlab.kitware.com/vtk/vtk/-/issues/18999 is adressed
-option(VTK_GENERATE_SPDX "Generate SPDX file for each module (Experimental)." OFF)
+option(VTK_GENERATE_SPDX "Generate SPDX file for each module." OFF)
 mark_as_advanced(VTK_GENERATE_SPDX)
 
 include(vtkEncodeString)
diff --git a/Documentation/docs/api/cmake/ModuleSystem.md b/Documentation/docs/api/cmake/ModuleSystem.md
index 8a3e91b4533..6a6bf5ad24c 100644
--- a/Documentation/docs/api/cmake/ModuleSystem.md
+++ b/Documentation/docs/api/cmake/ModuleSystem.md
@@ -997,6 +997,12 @@ to all files that are not parsed during generation, it is used to generate `Pack
 this in `vtk_module_build`) and expected field for [third parties](/developers_guide/git/thirdparty.md).
 If provided, it is used as is for the `PackageDownloadLocation` SPDX field.
 
+#### SPDX arguments in `vtk_module_add_module`
+
+It is possible to specify a `SPDX_SKIP_REGEX` when adding a module in order
+to skip specific file during [SPDX tags parsing](#spdx-tags-in-the-sources-files).
+It is a python regex which is used to match with the filename of the source files.
+
 #### Custom license support
 
 If the VTK module contains a custom license that is not part of the [SPDX license list](https://spdx.org/licenses/)
@@ -1027,10 +1033,7 @@ the `SPDX-License-Identifier` tag. Like this:
 ```
 
 If a source file does not contain both `SPDX-FileCopyrightText` and `SPDX-License-Identifier`
-tags, a CMake warning is reported.
-
-TODO: It would be possible to add a dedicated tag to identify that a file should NOT be parsed for SPDX tags,
-but it is not needed yet.
+tags, a warning at build time is reported.
 
 #### Limitations
 
@@ -1049,4 +1052,4 @@ but it is not needed yet.
 * Adding empty lines between `// SPDX-FileCopyrightText` and `// SPDX-License-Identifier`
   tags is not supported.
 
-* Only comments starting with `//` are considered.
+* Certain files are not parsed at all, eg: cmake files, python files, test files, ...
-- 
GitLab