diff options
author | Craig Scott <craig.scott@crascit.com> | 2022-08-14 05:17:20 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-08-14 05:17:27 (GMT) |
commit | a57ad5eba3419021b7fa2533297575e0e3f6c106 (patch) | |
tree | 7eeb843c46dfe4237b2c0088830a621c894caee9 | |
parent | db9453bbcfd7e9abc46a780f7298b60a2fe7ba73 (diff) | |
parent | b57681dc3431f44ad4a27a6a38fb68a5c6ca097f (diff) | |
download | CMake-a57ad5eba3419021b7fa2533297575e0e3f6c106.zip CMake-a57ad5eba3419021b7fa2533297575e0e3f6c106.tar.gz CMake-a57ad5eba3419021b7fa2533297575e0e3f6c106.tar.bz2 |
Merge topic 'FetchContent-protobuf-example-CMP0077'
b57681dc34 FetchContent: Fix protobuf example to avoid CMP0077 warning
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7565
-rw-r--r-- | Modules/FetchContent.cmake | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake index d016fb5..9747cd9 100644 --- a/Modules/FetchContent.cmake +++ b/Modules/FetchContent.cmake @@ -881,9 +881,10 @@ Overriding Where To Find CMakeLists.txt If the sub-project's ``CMakeLists.txt`` file is not at the top level of its source tree, the ``SOURCE_SUBDIR`` option can be used to tell ``FetchContent`` -where to find it. The following example shows how to use that option and +where to find it. The following example shows how to use that option, and it also sets a variable which is meaningful to the subproject before pulling -it into the main build: +it into the main build (set as an ``INTERNAL`` cache variable to avoid +problems with policy :policy:`CMP0077`): .. code-block:: cmake @@ -894,7 +895,7 @@ it into the main build: GIT_TAG ae50d9b9902526efd6c7a1907d09739f959c6297 # v3.15.0 SOURCE_SUBDIR cmake ) - set(protobuf_BUILD_TESTS OFF) + set(protobuf_BUILD_TESTS OFF CACHE INTERNAL "") FetchContent_MakeAvailable(protobuf) Complex Dependency Hierarchies |