
- #CMAKE COMMAND NOT FOUND GIT INSTALL#
- #CMAKE COMMAND NOT FOUND GIT GENERATOR#
- #CMAKE COMMAND NOT FOUND GIT CODE#
To compile protobuf: C:\Path\to\protobuf\cmake\build\release>nmake If the gmock directory does not exist, and you do not want to build protobuf unit tests, you need to add cmake command argument -Dprotobuf_BUILD_TESTS=OFF to disable testing. It will generate Visual Studio solution file protobuf.sln in current directory. To create Visual Studio solution file: C:\Path\to\protobuf\cmake\build>mkdir solution & cd solutionĬ:\Path\to\protobuf\cmake\build\solution>cmake -G "Visual StuWin64" ^

To use Debug configuration: C:\Path\to\protobuf\cmake\build>mkdir debug & cd debugĬ:\Path\to\protobuf\cmake\build\debug>cmake -G "NMake Makefiles" ^ It will generate nmake Makefile in current directory. To start using a Release configuration: C:\Path\to\protobuf\cmake\build>mkdir release & cd releaseĬ:\Path\to\protobuf\cmake\build\release>cmake -G "NMake Makefiles" ^
#CMAKE COMMAND NOT FOUND GIT GENERATOR#
The Makefile generator can build the project in only one configuration, so you need to build a separate folder for each configuration. We will use shadow building to separate the temporary files from the protobuf source code.Ĭreate a temporary build folder and change your working directory to it: C:\Path\to\protobuf\cmake>mkdir build & cd build We are only interested in Makefile and Visual Studio generators. CMake ConfigurationĬMake supports a lot of different generators for various native build systems. Now you are ready to CMake configuration. Now go to cmake folder in protobuf sources: C:\Path\to\protobuf\gmock>cd. If you absolutely don't want to build and run protobuf unit-tests, skip this steps and use protobuf at your own risk. Then go to gmock folder and download gtest: C:\Path\to\protobuf>cd gmockĬ:\Path\to\protobuf\gmock>git clone -b release-1.7.0 gtest You can download gmock as follows: C:\Path\to\protobuf>git clone -b release-1.7.0 gmock
#CMAKE COMMAND NOT FOUND GIT CODE#
If you checkout the code via git clone, this gmock directory won't exist and you will have to download it manually or skip building protobuf unit-tests. If you download protobuf source code from the releases page, the gmock directory should already be there. Protobuf unit-tests require gmock to build. Go to the project folder: C:\Path\to>cd protobuf Where is a git tag like v3.0.0-beta-1 or a branch name like master if you want to get the latest code. Or you can type: C:\Path\to> git clone -b You can get the latest stable source packages from the releases page. If git command is not available from Command Prompt, add it to system PATH variable: C:\Path\to>set PATH=%PATH% C:\Program Files\Git\cmd

If cmake command is not available from Command Prompt, add it to system PATH variable: C:\Path\to>set PATH=%PATH% C:\Program Files (x86)\CMake\bin
#CMAKE COMMAND NOT FOUND GIT INSTALL#
Where C:\Path\to is path to your real working directory.Ĭreate a folder where protobuf headers/libraries/binaries will be installed after built: C:\Path\to>mkdir install Open the appropriate Command Prompt from the Start menu.įor example VS2013 圆4 Native Tools Command Prompt: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64>Ĭhange to your working directory: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64>cd C:\Path\to Most of the instructions will be given to the Сommand Prompt, but the same actions can be performed using appropriate GUI tools. You need to have CMake, Visual Studio and optionally Git installed on your computer before proceeding. You can build the project from Command Prompt and using an Visual Studio IDE.

This directory contains CMake files that can be used to build protobuf with MSVC on Windows.
