CMAKE_PROJECT_HOMEPAGE_URL.rst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. CMAKE_PROJECT_HOMEPAGE_URL
  2. --------------------------
  3. The homepage URL of the top level project.
  4. This variable holds the homepage URL 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 value that ``CMAKE_PROJECT_HOMEPAGE_URL`` 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 HOMEPAGE_URL "http://first.example.com")
  13. project(Second HOMEPAGE_URL "http://second.example.com")
  14. add_subdirectory(sub)
  15. project(Third HOMEPAGE_URL "http://third.example.com")
  16. And ``sub/CMakeLists.txt`` with the following contents:
  17. .. code-block:: cmake
  18. project(SubProj HOMEPAGE_URL "http://subproj.example.com")
  19. message("CMAKE_PROJECT_HOMEPAGE_URL = ${CMAKE_PROJECT_HOMEPAGE_URL}")
  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_HOMEPAGE_URL = http://second.example.com
  23. To obtain the homepage URL from the most recent call to :command:`project` in
  24. the current directory scope or above, see the :variable:`PROJECT_HOMEPAGE_URL`
  25. variable.