CMAKE_LIST_FILE_NAME

4.0 版本新增。

CMake 项目文件的名称。这决定了 CMake 配置时处理的顶层文件,以及由 add_subdirectory() 处理的文件。

默认情况下,这是 CMakeLists.txt。如果设置为其他任何值,则在项目子目录中找不到指定文件时,CMakeLists.txt 将作为回退使用。

此变量报告通过 cmake --project-file 选项设置的值。此变量的值永远不应由项目或用户直接设置。

警告

备用项目文件名称的使用 intended for temporary use by developers during an incremental transition and not for publication of a final product. When the project file is anything other than CMakeLists.txt, CMake will always emit a warning.