PROJECT-NAME_IS_TOP_LEVEL.rst 648 B

123456789101112131415161718192021
  1. <PROJECT-NAME>_IS_TOP_LEVEL
  2. ---------------------------
  3. .. versionadded:: 3.21
  4. A boolean variable indicating whether the named project was called in a top
  5. level ``CMakeLists.txt`` file.
  6. To obtain the value from the most recent call to :command:`project` in
  7. the current directory scope or above, see the
  8. :variable:`PROJECT_IS_TOP_LEVEL` variable.
  9. The variable value will be true in:
  10. * the top-level directory of the project
  11. * the top-level directory of an external project added by :module:`ExternalProject`
  12. The variable value will be false in:
  13. * a directory added by :command:`add_subdirectory`
  14. * a directory added by :module:`FetchContent`