• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1CMAKE_PROJECT_HOMEPAGE_URL
2--------------------------
3
4.. versionadded:: 3.12
5
6The homepage URL of the top level project.
7
8This variable holds the homepage URL of the project as specified in the top
9level CMakeLists.txt file by a :command:`project` command.  In the event that
10the top level CMakeLists.txt contains multiple :command:`project` calls,
11the most recently called one from that top level CMakeLists.txt will determine
12the value that ``CMAKE_PROJECT_HOMEPAGE_URL`` contains.  For example, consider
13the following top level CMakeLists.txt:
14
15.. code-block:: cmake
16
17  cmake_minimum_required(VERSION 3.0)
18  project(First HOMEPAGE_URL "http://first.example.com")
19  project(Second HOMEPAGE_URL "http://second.example.com")
20  add_subdirectory(sub)
21  project(Third HOMEPAGE_URL "http://third.example.com")
22
23And ``sub/CMakeLists.txt`` with the following contents:
24
25.. code-block:: cmake
26
27  project(SubProj HOMEPAGE_URL "http://subproj.example.com")
28  message("CMAKE_PROJECT_HOMEPAGE_URL = ${CMAKE_PROJECT_HOMEPAGE_URL}")
29
30The most recently seen :command:`project` command from the top level
31CMakeLists.txt would be ``project(Second ...)``, so this will print::
32
33  CMAKE_PROJECT_HOMEPAGE_URL = http://second.example.com
34
35To obtain the homepage URL from the most recent call to :command:`project` in
36the current directory scope or above, see the :variable:`PROJECT_HOMEPAGE_URL`
37variable.
38