Linux 平台下用CMake搭建Eclipse CDT工程__Linux

來源:互聯網
上載者:User

1、項目目錄規劃

    在project_dir下建立build, cmake, src三個目錄。


2、編寫CMakeLists.txt檔案。


3、調用CMake命令為eclipse產生專案檔

點擊(此處)摺疊或開啟 mkdir -p build/release
mkdir -p build/debug
cmake -E chdir build/release cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=release ../../
cmake -E chdir build/debug cmake -G "Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=debug ../../
4 、開啟 eclipse
a.  選擇菜單:
File->Import ->General ->Existing Projects into Workspace
b. 點擊 “Next”,在 Select root directory 選擇 目錄為 project_dir/build
Eclipse 會自動搜尋到 debug, release 兩個目錄下的項目。
c. 點擊“Finish”按鈕。 eclipse 將自動加入項目。

5. 剩下的就是使用Eclipse CDT 偵錯工具了。

bless all

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.