CMAKE_SCRIPT_MODE_FILE

From Get docs
Cmake/docs/3.21/variable/cmake script mode file


CMAKE_SCRIPT_MODE_FILE

Full path to the cmake(1) -P script file currently being processed.

When run in cmake(1) -P script mode, CMake sets this variable to the full path of the script file. When run to configure a CMakeLists.txt file, this variable is not set.

© 2000–2021 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.21/variable/CMAKE_SCRIPT_MODE_FILE.html