You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Breaking change: Remove CMake submodule support in favor of fetched or installed dependencies.
This flips the default behavior to "fetch", downloading local copies of required dependencies. This can be disabled by setting `-Dprotobuf_FETCH_DEPENDENCIES=OFF`, in which case we will look for a local installation using find_package. Setting `-Dprotobuf_ABSL_PROVIDER=package` will continue to have the same behavior as before.
See https://protobuf.dev/news/2024-10-02/#replace-cmake-submods for more details.
#test-continuous
PiperOrigin-RevId: 686649864
Copy file name to clipboardExpand all lines: CMakeLists.txt
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -281,13 +281,13 @@ include_directories(
281
281
${protobuf_BINARY_DIR}/src
282
282
${protobuf_SOURCE_DIR}/src)
283
283
284
-
set(protobuf_FETCH_DEPENDENCIES OFFCACHEBOOL"Download dependencies from GitHub. If this option is not set, the dependency must be available locally, either as a sub-module or an installed package.")
284
+
set(protobuf_FETCH_DEPENDENCIES ONCACHEBOOL"Allow downloading dependencies from GitHub. If this option is not set, the dependency must be available locally as an installed package.")
285
285
286
-
set(protobuf_ABSL_PROVIDER "module"CACHESTRING"Provider of absl library. `module` uses sub-modules, `package` searches for a local installation, and `fetch` downloads from GitHub")
set(protobuf_ABSL_PROVIDER "fetch"CACHESTRING"Provider of absl library. `fetch` downloads from GitHub and `package` searches for a local installation")
set(protobuf_JSONCPP_PROVIDER "module"CACHESTRING"Provider of jsoncpp library. `module` uses sub-modules, `package` searches for a local installation, and `fetch` downloads from GitHub")
set(protobuf_JSONCPP_PROVIDER "fetch"CACHESTRING"Provider of jsoncpp library. `fetch` downloads from GitHub and `package` searches for a local installation")
Good. Now you are ready for *CMake* configuration.
93
86
94
87
## CMake Configuration
@@ -156,8 +149,8 @@ It will generate *Visual Studio* solution file *protobuf.sln* in current directo
156
149
157
150
Unit tests are being built along with the rest of protobuf. The unit tests require Google Mock (now a part of Google Test).
158
151
159
-
A copy of [Google Test](https://github.com/google/googletest) is included as a Git submodule in the `third-party/googletest` folder.
160
-
(You do need to initialize the Git submodules as explained above.)
152
+
By default, a local copy of [Google Test](https://github.com/google/googletest)
153
+
will be downloaded during CMake configuration.
161
154
162
155
Alternately, you may want to use protobuf in a larger set-up, you may want to use that standard CMake approach where
163
156
you build and install a shared copy of Google Test.
0 commit comments