參考地址:http://treefrogframework.github.io/treefrog-framework/user-guide/ch/install/
安裝
首先,我們需要先安裝好Qt庫.對於Windows和Mac OS X,從Qt 網站 下載並安裝它.對於Linux,你可以安裝一個發佈的包.如果是Ubuntu:安裝Qt庫和開發工具
$ sudo apt-get install -y qt5-default qt5-qmake libqt5sql5-mysql libqt5sql5-psql
libqt5sql5-odbc libqt5sql5-sqlite libqt5core5a libqt5qml5 libqt5xml5 qtbase5-dev
qtdeclarative5-dev qtbase5-dev-tools gcc g++ make
現在安裝數據庫客戶端庫:
$ sudo apt-get install -y libmysqlclient-dev libpq5 libodbc1
安裝說明
- 解壓已 下載的文件.以下命令應用到版本’x.x.x’.請對於的替換.
$ tar xvfz treefrog-x.x.x.tar.gz
- 運行build命令.對於Windows:請爲發行(releae)和調試(debugging)*創建兩種不同類型的二進制文件.打開Qt命令行窗口,然後使用以下命令Build.配置批處理文件(configure.bat)應該執行兩次.
> cd treefrog-x.x.x
> configure --enable-debug
> cd src
> mingw32-make install
> cd ..\tools
> mingw32-make install
> cd ..
> configure
> cd src
> mingw32-make install
> cd ..\tools
> mingw32-make install
在基於UNIX的操作系統Linux和Mac OS X:在命令行輸入以下命令:
$ cd treefrog-x.x.x
$ ./configure
$ cd src
$ make
$ sudo make install
$ cd ../tools
$ make
$ sudo make install
說明:
爲了調試Treefrog框架本身,請使用configure選項.現在請執行命令:
./configure --enable-debug
下一條命令更新動態鏈接器運行時綁定(僅在Linux).
$ sudo ldconfig
3.創建Treefrog命令行窗口的快捷方式(僅在Windows).在你想要的文件夾下點擊右鍵,選擇”新建”然後點擊”快捷方式”.設置鏈接目標如下:
C:\Windows\System32\cmd.exe /K C:\TreeFrog\x.x.x\bin\tfenv.bat
(‘x.x.x’表示當前使用的版本)
設置快捷方式的名字爲’Treefrog命令行窗口’.
配置選項
通過定義各自選項,可以進行環境的客戶化設定.在Windows上使用選項”configure option”:
> configure --help
Usage: configure [OPTION]... [VAR=VALUE]...
Configuration:
-h, --help display this help and exit
--enable-debug compile with debugging information
--enable-gui-mod compile and link with QtGui module
--enable-mongo compile with MongoDB driver library
Installation directories:
--prefix=PREFIX install files in PREFIX [C:\TreeFrog\x.x.x]
在Linux和類UNIX OS上使用選項:
$ ./configure --help
Usage: ./configure [OPTION]... [VAR=VALUE]...
Configuration:
-h, --help display this help and exit
--enable-debug compile with debugging information
--enable-gui-mod compile and link with QtGui module
--enable-mongo compile with MongoDB driver library
Installation directories:
--prefix=PREFIX install files in PREFIX [/usr]
Fine tuning of the installation directories:
--bindir=DIR user executables [/usr/bin]
--libdir=DIR object code libraries [/usr/lib]
--includedir=DIR C header files [/usr/include/treefrog]
--datadir=DIR read-only architecture-independent data [/usr/share/treefrog]
在Max OS X上使用選項:
$ ./configure --help
Usage: ./configure [OPTION]...[VAR=VALUE]...
Configuration:
-h, --help display this help and exit
--enable-debug compile with debugging information
--enable-gui-mod compile and link with QtGui module
--enable-mongo compile with MongoDB driver library
Fine tuning of the installation directories:
--framework=PREFIX install framework files in PREFIX [/Library/Frameworks]
--bindir=DIR user executables [/usr/bin]
--datadir=DIR read-only architecture-independent data [/usr/share/treefrog