• Home
  • Raw
  • Download

Lines Matching +full:cmake +full:- +full:3

1 This directory contains *CMake* files that can be used to build protobuf
5 You need to have [CMake](http://www.cmake.org), [Visual Studio](https://www.visualstudio.com)
6 and optionally [Git](http://git-scm.com) installed on your computer before proceeding.
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
48 For example: if you only need C++, download `protobuf-cpp-[VERSION].tar.gz`; if
49 you need C++ and Java, download `protobuf-java-[VERSION].tar.gz` (every package
51 download `protobuf-all-[VERSION].tar.gz`.
55 C:\Path\to> git clone -b [release_tag] https://github.com/protocolbuffers/protobuf.git
57 Where *[release_tag]* is a git tag like *v3.0.0-beta-1* or a branch name like *master*
69 C:\Path\to\protobuf> git submodule update --init --recursive
72 Now go to *cmake* folder in protobuf sources:
74 C:\Path\to\protobuf>cd cmake
75 C:\Path\to\protobuf\cmake>
77 Good. Now you are ready to *CMake* configuration.
79 CMake Configuration
82 *CMake* supports a lot of different
83 [generators](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html)
86 [Makefile](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html#makefile-generator…
88 [Visual Studio](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio
95 C:\Path\to\protobuf\cmake>mkdir build & cd build
96 C:\Path\to\protobuf\cmake\build>
103 C:\Path\to\protobuf\cmake\build>mkdir release & cd release
104 C:\Path\to\protobuf\cmake\build\release>cmake -G "NMake Makefiles" ^
105 -DCMAKE_BUILD_TYPE=Release ^
106 -DCMAKE_INSTALL_PREFIX=../../../../install ^
113 C:\Path\to\protobuf\cmake\build>mkdir debug & cd debug
114 C:\Path\to\protobuf\cmake\build\debug>cmake -G "NMake Makefiles" ^
115 -DCMAKE_BUILD_TYPE=Debug ^
116 -DCMAKE_INSTALL_PREFIX=../../../../install ^
123 C:\Path\to\protobuf\cmake\build>mkdir solution & cd solution
124 C:\Path\to\protobuf\cmake\build\solution>cmake -G "Visual Studio 16 2019" ^
125 -DCMAKE_INSTALL_PREFIX=../../../../install ^
131 you need to add *cmake* command argument `-Dprotobuf_BUILD_TESTS=OFF` to disable testing.
136 C:Path\to\protobuf\cmake\build\solution\CMakeCache
145 C:\Path\to\protobuf\cmake\build\release>nmake
149 C:\Path\to\protobuf\cmake\build\debug>nmake
164 To run unit-tests, first you must compile protobuf as described above.
167 C:\Path\to\protobuf\cmake\build\release>nmake check
171 C:\Path\to\protobuf\cmake\build\debug>nmake check
188 C:\Path\to\protobuf>cmake\build\release\tests.exe --gtest_filter=AnyTest*
191 [==========] Running 3 tests from 1 test case.
192 [----------] Global test environment set-up.
193 [----------] 3 tests from AnyTest
200 [----------] 3 tests from AnyTest (1 ms total)
202 [----------] Global test environment tear-down
203 [==========] 3 tests from 1 test case ran. (2 ms total)
204 [ PASSED ] 3 tests.
215 C:\Path\to\protobuf\cmake\build\release>nmake install
219 C:\Path\to\protobuf\cmake\build\debug>nmake install
225 * bin - that contains protobuf *protoc.exe* compiler;
226 * include - that contains C++ headers and protobuf *.proto files;
227 * lib - that contains linking libraries and *CMake* configuration files for *protobuf* package.
232 …* Copy linking libraries libprotobuf[d].lib, libprotobuf-lite[d].lib, and libprotoc[d].lib whereve…
249 * Add an additional flag `-Dprotobuf_BUILD_SHARED_LIBS=ON` when invoking cmake
258 libraries will *not* be usable as drop-in replacements.
260 If your project is itself a DLL intended for use by third-party software, we
272 Obtain a copy of the zlib library. The pre-compiled DLL at zlib.net works.
283 C:\Path\to>git clone -b v1.2.8 https://github.com/madler/zlib.git
290 C:\Path\to\zlib\build\release>cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ^
291 -DCMAKE_INSTALL_PREFIX=../../../install ../..
301 You need reconfigure protobuf with flag `-Dprotobuf_WITH_ZLIB=ON` when invoking cmake.
304 further disable the option `-Dprotobuf_MSVC_STATIC_RUNTIME=OFF`.
311 -DZLIB_INCLUDE_DIR=<path to dir containing zlib headers>
312 -DZLIB_LIB=<path to dir containing zlib>
323 * C4018 - 'expression' : signed/unsigned mismatch
324 * C4146 - unary minus operator applied to unsigned type, result still unsigned
325 * C4244 - Conversion from 'type1' to 'type2', possible loss of data.
326 * C4251 - 'identifier' : class 'type' needs to have dll-interface to be used by
328 * C4267 - Conversion from 'size_t' to 'type', possible loss of data.
329 * C4305 - 'identifier' : truncation from 'type1' to 'type2'
330 * C4355 - 'this' : used in base member initializer list
331 * C4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning)
332 * C4996 - 'function': was declared deprecated