Files
CMake/Help/variable/CMAKE_PARENT_LIST_FILE.rst
Benjamin Buch a9ea55f0d7 Fix CMAKE_PARENT_LIST_FILE after return from include() or find_package()
Fix the implementation, clarify the documentation, and add tests.

Fixes: #25026
Co-authored-by: Brad King <brad.king@kitware.com>
2025-04-12 09:40:37 -04:00

16 lines
545 B
ReStructuredText

CMAKE_PARENT_LIST_FILE
----------------------
Full path to the CMake file that included the current one.
While processing a CMake file loaded by :command:`include` or
:command:`find_package` this variable contains the full path to the file
including it.
While processing a ``CMakeLists.txt`` file, even in subdirectories,
this variable has the same value as :variable:`CMAKE_CURRENT_LIST_FILE`.
While processing a :option:`cmake -P` script, this variable is not defined
in the outermost script.
See also :variable:`CMAKE_CURRENT_LIST_FILE`.