linux cmake安裝方法
OpenCV 2.2以后的版本需要使用Cmake生成makefile文件,因此需要先安裝cmake;還有其它一些軟件都需要先安裝cmake
1.在linux環境下打開網頁瀏覽器,輸入網址:<a title="http://www.cmake.org/cmake/resources/software.html" href="http://www.cmake.org/cmake/resources/software.html">http://www.cmake.org/cmake/resources/software.html</a>,找到最新版本的位置。一般開放源代碼軟件都會有兩個版本發布:Source Distribution 和 Binary Distribution<span class="Apple-converted-space">,前者是源代碼版,你需要自己編譯成可執行軟件。后者是已經編譯好的可執行版,直接可以拿來用的。</span>
<img src="https://images2015.cnblogs.com/blog/994176/201607/994176-20160718145254435-137933006.jpg" alt="" width="741" height="435" />
2.在linux環境下打開終端,輸入:
<div class="cnblogs_code">
<pre>getconf LONG_BIT</pre>
</div>
如果結果是64表示該系統是linux64位的,如果結果是32則表示系統是linux32位。
3.我現在所用的這台是64位,因此在cmake安裝包的網站中選擇binary distribution下的linux x86_64下的cmake-3.6.0-Linux-x86 64.tar.gz壓縮包,點擊,下載。默認下載到了home/DOWNLOAD
4.把下載好的包復制到指定路徑,比如/home/bnu,在當前文件夾中打開終端,輸入
<div class="cnblogs_code">
<pre>tar zxvf cmake-3.6.0-Linux-x86 64.tar.gz</pre>
</div>
在該目錄下多了一個解壓后的文件夾 添加環境變量
<div class="cnblogs_code">
<pre>export PATH=$PATH:/home/bnu/cmake-3.6.0-Linux-x86 64/bin</pre>
</div>
輸入完畢保存
7.查看版本,測試是否安裝成功:打開終端,輸入
<div class="cnblogs_code">
<pre>cmake --version</pre>
</div>
