diff options
author | Brad King <brad.king@kitware.com> | 2021-07-08 13:44:02 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-07-08 09:44:08 -0400 |
commit | 2402789abaf5aaf73f8ff78860c75a8a7120aa0d (patch) | |
tree | 5f43fa8c0b2939b524f7ef0e29a1fd593ee1a53e | |
parent | a5ab4c741fb1edce6191871368cda9ddfd6cd50f (diff) | |
parent | 2df4badc5f5902ae6808cb3c4b0c3c8484686b5d (diff) | |
download | cmake-2402789abaf5aaf73f8ff78860c75a8a7120aa0d.tar.gz |
Merge topic 'help_toplevel' into release-3.21
2df4badc5f Help: Note PROJECT_IS_TOP_LEVEL behavior w.r.t. ExternalProject
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6307
-rw-r--r-- | Help/variable/PROJECT-NAME_IS_TOP_LEVEL.rst | 10 | ||||
-rw-r--r-- | Help/variable/PROJECT_IS_TOP_LEVEL.rst | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/Help/variable/PROJECT-NAME_IS_TOP_LEVEL.rst b/Help/variable/PROJECT-NAME_IS_TOP_LEVEL.rst index 953e9783fd..6718ecfd95 100644 --- a/Help/variable/PROJECT-NAME_IS_TOP_LEVEL.rst +++ b/Help/variable/PROJECT-NAME_IS_TOP_LEVEL.rst @@ -9,3 +9,13 @@ level ``CMakeLists.txt`` file. To obtain the value from the most recent call to :command:`project` in the current directory scope or above, see the :variable:`PROJECT_IS_TOP_LEVEL` variable. + +The variable value will be true in: + +* the top-level directory of the project +* the top-level directory of an external project added by :module:`ExternalProject` + +The variable value will be false in: + +* a directory added by :command:`add_subdirectory` +* a directory added by :module:`FetchContent` diff --git a/Help/variable/PROJECT_IS_TOP_LEVEL.rst b/Help/variable/PROJECT_IS_TOP_LEVEL.rst index e5eb6c1231..ad61fecc05 100644 --- a/Help/variable/PROJECT_IS_TOP_LEVEL.rst +++ b/Help/variable/PROJECT_IS_TOP_LEVEL.rst @@ -19,3 +19,13 @@ options: if(PROJECT_IS_TOP_LEVEL) include(CTest) endif() + +The variable value will be true in: + +* the top-level directory of the project +* the top-level directory of an external project added by :module:`ExternalProject` + +The variable value will be false in: + +* a directory added by :command:`add_subdirectory` +* a directory added by :module:`FetchContent` |