diff options
author | Craig Scott <craig.scott@crascit.com> | 2022-05-06 12:33:22 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-05-06 08:33:38 -0400 |
commit | c5dff5ace263c469bbd97d745f3b9eecae40d0aa (patch) | |
tree | 05c5767b7abb1363cbe1e468cde6e7386899caf1 /Help/variable | |
parent | 30f91596677b0b93f22b5123d27fb76f494d0864 (diff) | |
parent | 29e31e2825a2cd5099b8abe66f4816919cec934a (diff) | |
download | cmake-c5dff5ace263c469bbd97d745f3b9eecae40d0aa.tar.gz |
Merge topic 'FetchContent_find_package_integration'
29e31e2825 Packages: Integrate FetchContent and find_package()
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: huangqinjin <huangqinjin@gmail.com>
Merge-request: !5688
Diffstat (limited to 'Help/variable')
-rw-r--r-- | Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst b/Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst new file mode 100644 index 0000000000..fa414e4044 --- /dev/null +++ b/Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst @@ -0,0 +1,27 @@ +CMAKE_FIND_PACKAGE_REDIRECTS_DIR +-------------------------------- + +.. versionadded:: 3.24 + +This read-only variable specifies a directory that the :command:`find_package` +command will check first before searching anywhere else for a module or config +package file. A config package file in this directory will always be found in +preference to any other Find module file or config package file. + +The primary purpose of this variable is to facilitate integration between +:command:`find_package` and :command:`FetchContent_MakeAvailable`. The latter +command may create files in the ``CMAKE_FIND_PACKAGE_REDIRECTS_DIR`` directory +when it populates a dependency. This allows subsequent calls to +:command:`find_package` for the same dependency to re-use the populated +contents instead of trying to satisfy the dependency from somewhere external +to the build. Projects may also want to write files into this directory in +some situations (see :ref:`FetchContent-find_package-integration` for examples). + +The directory that ``CMAKE_FIND_PACKAGE_REDIRECTS_DIR`` points to will always +be erased and recreated empty at the start of every CMake run. Any files +written into this directory during the CMake run will be lost the next time +CMake configures the project. + +``CMAKE_FIND_PACKAGE_REDIRECTS_DIR`` is only set in CMake project mode. +It is not set when CMake is run in script mode +(i.e. :manual:`cmake -P ... <cmake(1)>`). |