[Qt] Use qmake to automatic create project file and Makefile

在沒有使用 IDE 環境的狀況下,當我們撰寫完 Qt 程式碼後,為了能夠編譯出可執行檔,這時我們可以使用 qmake 這個工具來幫助我們建立 Qt 專案檔及 Makefile 檔。

qmake 有兩種模式,一個是 project,另一個則是 makefile。

project mode 是協助使用者建立專案檔,而 makefile mode 則是產生 Makefile 檔,透過 qmake 工具,使用者就不用自己去寫 Makefile 檔案,省去不少麻煩。

以下是簡要的步驟:

1. Create the Porject File:

In your source code directory,

#> qmake -project project_name

You have to give a project name for qmake.

After this step, you can get the .pro file.

2. Create the Makefile:

In your source code directory,

#> qmake -makefile

One comment

發佈留言