Listfiles(CMake)

Listfiles(CMake)

Content #

Files that contain the CMake language are called listfiles and can be included one in another, by calling include() and find_package(), or indirectly with add_subdirectory().

  1. They have a .cmake extension usually.
  2. As CMake walks the source tree and includes different listfiles, the following variables are set:
    • CMAKE_CURRENT_LIST_DIR
    • CMAKE_CURRENT_LIST_FILE
    • CMAKE_PARENT_LIST_FILE
    • CMAKE_CURRENT_LIST_LINE

From #