Lines Matching +full:project +full:- +full:src +full:- +full:path
2 with *MSVC* on *Windows*. You can build the project from *Command Prompt*
6 and optionally [Git](http://git-scm.com) installed on your computer before proceeding.
22 C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>cd C:\Path\to
23 C:\Path\to>
25 Where *C:\Path\to* is path to your real working directory.
29 C:\Path\to>mkdir install
31 If *cmake* command is not available from *Command Prompt*, add it to system *PATH* variable:
33 C:\Path\to>set PATH=%PATH%;C:\Program Files (x86)\CMake\bin
35 If *git* command is not available from *Command Prompt*, add it to system *PATH* variable:
37 C:\Path\to>set PATH=%PATH%;C:\Program Files\Git\cmd
39 Optionally, you will want to download [ninja](https://ninja-build.org/) and add it to your *PATH* v…
41 C:\Path\to>set PATH=%PATH%;C:\tools\ninja
52 For example: if you only need C++, download `protobuf-cpp-[VERSION].tar.gz`; if
53 you need C++ and Java, download `protobuf-java-[VERSION].tar.gz` (every package
55 download `protobuf-all-[VERSION].tar.gz`.
59 C:\Path\to> mkdir src & cd src
60 C:\Path\to\src> git clone -b [release_tag] https://github.com/protocolbuffers/protobuf.git
62 Where *[release_tag]* is a git tag like *v3.0.0-beta-1* or a branch name like *main*
65 Go to the project folder:
67 C:\Path\to\src> cd protobuf
68 C:\Path\to\src\protobuf>
74 C:\Path\to\src\protobuf> git submodule update --init --recursive
83 [generators](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html)
88 * [Makefile](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html#makefile-generat…
91 … Studio](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-gener…
92 This generates a Visual Studio solution for the project.
94 * [Ninja](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#ninja-generator)
95 …This uses the external tool [Ninja](https://ninja-build.org/) to build. It is the fastest solution…
98 …support for opening directly CMake-based projects](https://docs.microsoft.com/en-us/cpp/build/cmak…
104 mkdir C:\Path\to\build\protobuf
105 cd C:\Path\to\build\protobuf
106 C:\Path\to\build\protobuf>
108 The *Makefile* and *Ninja* generators can build the project in only one configuration, so you need …
113 C:\Path\to\build\protobuf>mkdir release & cd release
114 C:\Path\to\build\protobuf\release>cmake -G "NMake Makefiles" ^
115 -DCMAKE_BUILD_TYPE=Release ^
116 -DCMAKE_INSTALL_PREFIX=C:\Path\to\install ^
117 C:\Path\to\src\protobuf
123 C:\Path\to\build\protobuf>mkdir debug & cd debug
124 C:\Path\to\build\protobuf\debug>cmake -G "Ninja" ^
125 -DCMAKE_BUILD_TYPE=Debug ^
126 -DCMAKE_INSTALL_PREFIX=C:\Path\to\install ^
127 C:\Path\to\src\protobuf
131 The *Visual Studio* generator is multi-configuration: it will generate a single *.sln* file that ca…
133 C:\Path\to\build\protobuf>mkdir solution & cd solution
134 C:\Path\to\build\protobuf\solution>cmake -G "Visual Studio 16 2019" ^
135 -DCMAKE_INSTALL_PREFIX=C:\Path\to\install ^
136 C:\Path\to\src\protobuf
141 ----------
145 …//github.com/google/googletest) is included as a Git submodule in the `third-party/googletest` fol…
148 Alternately, you may want to use protobuf in a larger set-up, you may want to use that standard CMa…
152 during the configuration step: `-Dprotobuf_USE_EXTERNAL_GTEST=ON`.
157 Google Test in your project's root directory (i.e. the same directory you've passed to `CMAKE_INSTA…
163 C:\Path\to\build\protobuf>mkdir solution & cd solution
164 C:\Path\to\build\protobuf\solution>cmake -G "Visual Studio 16 2019" ^
165 -DCMAKE_INSTALL_PREFIX=C:\Path\to\install ^
166 -DCMAKE_PREFIX_PATH=C:\Path\to\my_big_project ^
167 -Dprotobuf_USE_EXTERNAL_GTEST=ON ^
168 C:\Path\to\src\protobuf
172 …etely, you need to add the following argument to you *cmake* command line: `-Dprotobuf_BUILD_TESTS…
176 C:\Path\to\build\protobuf\solution>cmake -G "Visual Studio 16 2019" ^
177 -DCMAKE_INSTALL_PREFIX=C:\Path\to\install ^
178 -Dprotobuf_BUILD_TESTS=OFF ^
179 C:\Path\to\src\protobuf
184 The standard way to compile a *CMake* project is `cmake --build <directory>`.
189 cmake --build C:\Path\to\build\protobuf\solution --config Release
193 C:\Path\to\build\protobuf\release>nmake
197 C:\Path\to\build\protobuf\debug>ninja
212 To run unit-tests, first you must compile protobuf as described above.
215 C:\Path\to\protobuf\cmake\build\release>ctest --progress --output-on-failure
219 C:\Path\to\protobuf\cmake\build\release>cmake --build . --target check
223 C:\Path\to\build\protobuf\release>ninja check
225 You can also build project *check* from Visual Studio solution.
240 C:\Path\to\build\protobuf\release>tests.exe --gtest_filter=AnyTest*
244 [----------] Global test environment set-up.
245 [----------] 3 tests from AnyTest
252 [----------] 3 tests from AnyTest (1 ms total)
254 [----------] Global test environment tear-down
267 cmake --build C:\Path\to\build\protobuf\solution --config Release --target install
271 C:\Path\to\build\protobuf\release>nmake install
275 C:\Path\to\build\protobuf\debug>ninja install
277 You can also build project *INSTALL* from Visual Studio solution.
281 * bin - that contains protobuf *protoc.exe* compiler;
282 * include - that contains C++ headers and protobuf *.proto files;
283 * lib - that contains linking libraries and *CMake* configuration files for *protobuf* package.
287 * Copy protoc.exe wherever you put build tools (probably somewhere in your PATH).
288 …* Copy linking libraries libprotobuf[d].lib, libprotobuf-lite[d].lib, and libprotoc[d].lib whereve…
305 * Add an additional flag `-Dprotobuf_BUILD_SHARED_LIBS=ON` when invoking cmake
307 * When compiling your project, make sure to `#define PROTOBUF_USE_DLLS`.
314 libraries will *not* be usable as drop-in replacements.
316 If your project is itself a DLL intended for use by third-party software, we
328 Obtain a copy of the zlib library. The pre-compiled DLL at zlib.net works.
331 * Make sure zlib's two headers are in your `C:\Path\to\install\include` path
333 `C:\Path\to\install\lib` library path.
339 C:\Path\to\src>git clone -b v1.2.8 https://github.com/madler/zlib.git
340 C:\Path\to\src>cd zlib
344 C:\Path\to\src\zlib>mkdir C:\Path\to\build\zlib & cd C:\Path\to\build\zlib
345 C:\Path\to\build\zlib>mkdir release & cd release
346 C:\Path\to\build\zlib\release>cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release ^
347 -DCMAKE_INSTALL_PREFIX=C:\Path\to\install C:\Path\to\src\zlib
348 C:\Path\to\src\zlib\build\release>cmake --build . --target install
351 protobuf project.
353 Now add *bin* folder from *install* to system *PATH*:
355 C:\Path\to>set PATH=%PATH%;C:\Path\to\install\bin
357 You need reconfigure protobuf with flag `-Dprotobuf_WITH_ZLIB=ON` when invoking cmake.
360 further disable the option `-Dprotobuf_MSVC_STATIC_RUNTIME=OFF`.
367 -DZLIB_INCLUDE_DIR=<path to dir containing zlib headers>
368 -DZLIB_LIB=<path to dir containing zlib>
376 and compiler. You may have to disable some of them in your own project as
379 * C4244 - Conversion from 'type1' to 'type2', possible loss of data.
380 * C4251 - 'identifier' : class 'type' needs to have dll-interface to be used by
382 * C4267 - Conversion from 'size_t' to 'type', possible loss of data.
383 * C4305 - 'identifier' : truncation from 'type1' to 'type2'
384 * C4355 - 'this' : used in base member initializer list
385 * C4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning)
386 * C4996 - 'function': was declared deprecated