i7@pc:~$ sudo apt-get install libgtest-dev
[sudo] i7 的密碼:
正在讀取軟件包列表... 完成
正在分析軟件包的依賴關系樹
正在讀取狀態(tài)信息... 完成
將會同時安裝下列軟件:
googletest
下列【新】軟件包將被安裝:
googletest libgtest-dev
升級了 0 個軟件包,新安裝了 2 個軟件包砖第,要卸載 0 個軟件包余指,有 0 個軟件包未被升級。
需要下載 658 kB 的歸檔让网。
解壓縮后會消耗 7,608 kB 的額外空間。
您希望繼續(xù)執(zhí)行嗎? [Y/n] y
獲取:1 http://packages.deepin.com/deepin panda/main amd64 googletest amd64 1.8.0-6 [653 kB]
獲取:2 http://packages.deepin.com/deepin panda/main amd64 libgtest-dev amd64 1.8.0-6 [5,110 B]
已下載 658 kB事期,耗時 1分 7秒 (9,711 B/s)
正在選中未選擇的軟件包 googletest:amd64。
(正在讀取數(shù)據(jù)庫 ... 系統(tǒng)當前共安裝有 198108 個文件和目錄纸颜。)
正準備解包 .../googletest_1.8.0-6_amd64.deb ...
正在解包 googletest:amd64 (1.8.0-6) ...
正在選中未選擇的軟件包 libgtest-dev:amd64刑赶。
正準備解包 .../libgtest-dev_1.8.0-6_amd64.deb ...
正在解包 libgtest-dev:amd64 (1.8.0-6) ...
正在設置 googletest:amd64 (1.8.0-6) ...
正在設置 libgtest-dev:amd64 (1.8.0-6) ...
正在處理用于 man-db (2.7.6.1-2) 的觸發(fā)器 ...
i7@pc:~$ cd /usr/src/gtest
i7@pc:/usr/src/gtest$ sudo mkdir build
i7@pc:/usr/src/gtest$ cd build
i7@pc:/usr/src/gtest/build$ sudo cmake ..
-- The CXX compiler identification is GNU 6.4.0
-- The C compiler identification is GNU 6.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.13")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/googletest/googletest/build
i7@pc:/usr/src/gtest/build$ sudo make
Scanning dependencies of target gtest
[ 25%] Building CXX object CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 50%] Linking CXX static library libgtest.a
[ 50%] Built target gtest
Scanning dependencies of target gtest_main
[ 75%] Building CXX object CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[100%] Linking CXX static library libgtest_main.a
[100%] Built target gtest_main
i7@pc:/usr/src/gtest/build$ sudo make install
[ 50%] Built target gtest
[100%] Built target gtest_main
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/libgtest.a
-- Installing: /usr/local/lib/libgtest_main.a
-- Installing: /usr/local/include/gtest
-- Installing: /usr/local/include/gtest/gtest-printers.h
-- Installing: /usr/local/include/gtest/gtest-param-test.h.pump
-- Installing: /usr/local/include/gtest/gtest-spi.h
-- Installing: /usr/local/include/gtest/gtest-death-test.h
-- Installing: /usr/local/include/gtest/gtest-param-test.h
-- Installing: /usr/local/include/gtest/gtest-typed-test.h
-- Installing: /usr/local/include/gtest/gtest-message.h
-- Installing: /usr/local/include/gtest/gtest_prod.h
-- Installing: /usr/local/include/gtest/internal
-- Installing: /usr/local/include/gtest/internal/gtest-port-arch.h
-- Installing: /usr/local/include/gtest/internal/gtest-param-util.h
-- Installing: /usr/local/include/gtest/internal/gtest-string.h
-- Installing: /usr/local/include/gtest/internal/gtest-death-test-internal.h
-- Installing: /usr/local/include/gtest/internal/gtest-linked_ptr.h
-- Installing: /usr/local/include/gtest/internal/gtest-filepath.h
-- Installing: /usr/local/include/gtest/internal/gtest-param-util-generated.h.pump
-- Installing: /usr/local/include/gtest/internal/gtest-param-util-generated.h
-- Installing: /usr/local/include/gtest/internal/gtest-internal.h
-- Installing: /usr/local/include/gtest/internal/custom
-- Installing: /usr/local/include/gtest/internal/custom/gtest-printers.h
-- Installing: /usr/local/include/gtest/internal/custom/gtest-port.h
-- Installing: /usr/local/include/gtest/internal/custom/gtest.h
-- Installing: /usr/local/include/gtest/internal/gtest-type-util.h
-- Installing: /usr/local/include/gtest/internal/gtest-type-util.h.pump
-- Installing: /usr/local/include/gtest/internal/gtest-tuple.h.pump
-- Installing: /usr/local/include/gtest/internal/gtest-port.h
-- Installing: /usr/local/include/gtest/internal/gtest-tuple.h
-- Installing: /usr/local/include/gtest/gtest_pred_impl.h
-- Installing: /usr/local/include/gtest/gtest.h
-- Installing: /usr/local/include/gtest/gtest-test-part.h