diff options
author | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-12-11 03:22:43 (GMT) |
---|---|---|
committer | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-12-11 03:22:43 (GMT) |
commit | 92764e9c933ebd45477ae59bfa6f3dfb697819ec (patch) | |
tree | 4d0c5141e6a8ee295ff699e9bf243a0ea52a1c6c /README | |
parent | 3bcc7a2173254f1d2504fbad29a465ac7dc8edb9 (diff) | |
download | googletest-92764e9c933ebd45477ae59bfa6f3dfb697819ec.zip googletest-92764e9c933ebd45477ae59bfa6f3dfb697819ec.tar.gz googletest-92764e9c933ebd45477ae59bfa6f3dfb697819ec.tar.bz2 |
Improves the instructions in README.
Diffstat (limited to 'README')
-rw-r--r-- | README | 56 |
1 files changed, 36 insertions, 20 deletions
@@ -77,16 +77,23 @@ or for a release version X.Y.*'s branch: Next you will need to prepare the GNU Autotools build system, if you are using Linux, Mac OS X, or Cygwin. Enter the target directory of the checkout command you used ('gtest-svn' or 'gtest-X.Y-svn' above) -and proceed with the following command to bootstrap the build system: +and proceed with the following command: - $ ACLOCAL=aclocal-1.9 AUTOMAKE=automake-1.9 autoreconf -fiv + $ autoreconf -fvi -You can substitute newer versions of 'aclocal' and 'automake', but be aware -that older versions are known not to work, and autoreconf may or may not -correctly detect the required version. Also, the versions must match for both -commands. However, this entire process will be automatically re-run by your -"make" invocations, so in practice you shouldn't need to worry too much. Once -you have completed these steps, you are ready to build the library. +Once you have completed this step, you are ready to build the library. Note +that you should only need to complete this step once. The subsequent `make' +invocations will automatically re-generate the bits of the build system that +need to be changed. + +If your system uses older versions of the autotools, the above command will +fail. You may need to explicitly specify a version to use. For instance, if you +have both GNU Automake 1.4 and 1.9 installed and `automake' would invoke the +1.4, use instead: + + $ AUTOMAKE=automake-1.9 ACLOCAL=aclocal-1.9 autoreconf -fvi + +Make sure you're using the same version of automake and aclocal. ### Source Package: ### Google Test is also released in source packages which can be downloaded from @@ -131,21 +138,30 @@ libraries to leverage it: $ sudo make install # Not necessary, but allows use by other programs -TODO(chandlerc@google.com): This section needs to be expanded when the -'gtest-config' script is finished and Autoconf macro's are provided (or not -provided) in order to properly reflect the process for other programs to -locate, include, and link against Google Test. - -Finally, should you need to remove Google Test from your system after having -installed it, run the following command, and it will back out its changes. -However, note carefully that you must run this command on the *same* Google -Test build that you ran the install from, or the results are not predictable. -If you install Google Test on your system, and are working from a VCS checkout, -make sure you run this *before* updating your checkout of the source in order -to uninstall the same version which you installed. +Should you need to remove Google Test from your system after having installed +it, run the following command, and it will back out its changes. However, note +carefully that you must run this command on the *same* Google Test build that +you ran the install from, or the results are not predictable. If you install +Google Test on your system, and are working from a VCS checkout, make sure you +run this *before* updating your checkout of the source in order to uninstall +the same version which you installed. $ sudo make uninstall # Must be run against the exact same build as "install" +Your project can build against Google Test simply by leveraging the +'gtest-config' script. This script can be invoked directly out of the 'scripts' +subdirectory of the build tree, and it will be installed in the binary +directory specified during the 'configure'. Here are some examples of its use, +see 'gtest-config --help' for more detailed information. + + $ gtest-config --min-version=1.0 || echo "Insufficient Google Test version." + + $ g++ $(gtest-config --cppflags --cxxflags) -o foo.o -c foo.cpp + $ g++ $(gtest-config --ldflags --libs) -o foo foo.o + + # When using a built but not installed Google Test: + $ g++ $(../../my_gtest_build/scripts/gtest-config ...) ... + ### Windows ### Open the gtest.sln file in the msvc/ folder using Visual Studio, and you are ready to build Google Test the same way you build any Visual |