aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake/README.md
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2015-06-05 17:59:09 -0700
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2015-06-05 23:57:01 -0700
commitee6b3d55297978fbf8541218faf8bf862b6c2c9d (patch)
treedc90b398c7ef3981ea651041221b8ba8186b73b8 /cmake/README.md
parentdffd542bb8d45f6846a65864a39674669915fce6 (diff)
Remove vsprojects.
Diffstat (limited to 'cmake/README.md')
-rw-r--r--cmake/README.md36
1 files changed, 24 insertions, 12 deletions
diff --git a/cmake/README.md b/cmake/README.md
index 02798b63..1d5c8bc1 100644
--- a/cmake/README.md
+++ b/cmake/README.md
@@ -5,15 +5,21 @@ on your computer before proceeding.
Compiling and Installing
========================
-1. Check whether a gtest directory exists in the upper level directory. If
- you checkout the code from github via "git clone", this gtest directory
- won't exist and you won't be able to build the tests described below. To
- avoid this problem consider downloading one of the release tar balls which
- contains gtest already and copying the gest directory from there to your
- protobuf directory:
+1. Check whether a gtest directory exists in the upper level directory. If you
+ checkout the code from github via "git clone", this gtest directory won't
+ exist and you won't be able to build protobuf unit-tests. Consider using one
+ of the release tar balls instead:
https://github.com/google/protobuf/releases
+ These release tar balls are more stable versions of protobuf and already
+ have the gtest directory included.
+
+ You can also download gtest by yourself and put it in the right place.
+
+ If you absolutely don't want to build and run protobuf unit-tests, skip
+ this step and use protobuf at your own risk.
+
2. Use cmake to generate MSVC project files. Running the following commands
in a command shell will generate project files for Visual Studio 2008 in
a sub-directory named "build".
@@ -23,21 +29,27 @@ Compiling and Installing
$ cd build
$ cmake -G "Visual Studio 9 2008" ..
+ If you don't have gtest, skip the build of tests by turning off the
+ BUILD_TESTING option:
+
+ $ cmake -G "Visutal Studio 9 2008" -DBUILD_TESTING=OFF ..
+
3. Open the generated protobuf.sln file in Microsoft Visual Studio.
4. Choose "Debug" or "Release" configuration as desired.
5. From the Build menu, choose "Build Solution". Wait for compiling to finish.
-6. From a command shell, run tests.exe and lite-test.exe and check that all
- tests pass. Make sure you have changed the working directory to the output
- directory because tests.exe will try to find and run test_plugin.exe
- in the working directory.
+6. If you have built tests, run tests.exe and lite-test.exe from a command
+ shell and check that all tests pass. Make sure you have changed the working
+ directory to the output directory because tests.exe will try to find and run
+ test_plugin.exe in the working directory.
7. Run extract_includes.bat to copy all the public headers into a separate
- "include" directory (under the top-level package directory).
+ "include" directory. This batch script can be found along with the generated
+ protobuf.sln file in the same directory.
8. Copy the contents of the include directory to wherever you want to put
headers.
9. Copy protoc.exe wherever you put build tools (probably somewhere in your
PATH).
10. Copy libprotobuf.lib, libprotobuf-lite.lib, and libprotoc.lib wherever you
- put libraries.
+ put libraries.
To avoid conflicts between the MSVC debug and release runtime libraries, when
compiling a debug build of your application, you may need to link against a