You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB

  1. CMAKE_PROJECT_DESCRIPTION
  2. -------------------------
  3. The description of the top level project.
  4. This variable holds the description of the project as specified in the top
  5. level CMakeLists.txt file by a :command:`project` command. In the event that
  6. the top level CMakeLists.txt contains multiple :command:`project` calls,
  7. the most recently called one from that top level CMakeLists.txt will determine
  8. the name that ``CMAKE_PROJECT_DESCRIPTION`` contains. For example, consider
  9. the following top level CMakeLists.txt:
  10. .. code-block:: cmake
  11. cmake_minimum_required(VERSION 3.0)
  12. project(First DESCRIPTION "I am First")
  13. project(Second DESCRIPTION "I am Second")
  14. add_subdirectory(sub)
  15. project(Third DESCRIPTION "I am Third")
  16. And ``sub/CMakeLists.txt`` with the following contents:
  17. .. code-block:: cmake
  18. project(SubProj DESCRIPTION "I am SubProj")
  19. message("CMAKE_PROJECT_DESCRIPTION = ${CMAKE_PROJECT_DESCRIPTION}")
  20. The most recently seen :command:`project` command from the top level
  21. CMakeLists.txt would be ``project(Second ...)``, so this will print::
  22. CMAKE_PROJECT_DESCRIPTION = I am Second
  23. To obtain the description from the most recent call to :command:`project` in
  24. the current directory scope or above, see the :variable:`PROJECT_DESCRIPTION`
  25. variable.