Chinaunix首页 | 论坛 | 博客
  • 博客访问: 399120
  • 博文数量: 101
  • 博客积分: 2207
  • 博客等级: 大尉
  • 技术积分: 2508
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-19 20:45
文章分类

全部博文(101)

文章存档

2013年(15)

2012年(86)

我的朋友

分类: LINUX

2012-07-19 10:12:33

编译步骤如下
1.使用svn下载源码
svn checkout googletest
2.cd googletest查看README里面的Setting up the Build
3.编译方式分两种,
一种使用gmake
 g++ -I${GTEST_DIR}/include -I${GTEST_DIR} -c ${GTEST_DIR}/src/gtest-all.cc
ar -rv libgtest.a gtest-all.o
这里${GTEST_DIR}为当前目录于是命令行为
g++ -I./include -I./ -c ./src/gtest-all.cc
ar -rv libgtest.a gtest-all.o
另一种使用cmake
 mkdir mybuild       # Create a directory to hold the build output.
  cd mybuild
  cmake ${GTEST_DIR}  # Generate native build scripts.
If you want to build Google Test's samples, you should replace the
last command with
  cmake -Dgtest_build_samples=ON ${GTEST_DIR}
我们如下
mkdir build
cd build
cmake -Dgtest_build_samples=ON ..
生成Makefile,运行make
阅读(6309) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~