Ogitor-0.4.2源代码构建,不少时间,这里记录一下:
(一)构建QT
1.环境变量中加入bin路径:PATH--->C:/Qt/4.6.3/bin(我的路径是)
2.环境变量中加入qt的路径:QTDIR--->C:/Qt/4.6.3
3.打开vs2008的命令提示行(如图)
4.进入qt目录:cd C:/Qt/4.6.3
5.执行:configure -platform win32-msvc2008 -nomake demos -nomake examples -no-opengl -no-qt3support。
6.几分钟后完成,再执行:nmake。这个等得比较久,估计2,3个小时吧
qt构建完成
(二)构建OGRE1.7.1,先编译Dependencies,再用CMAKE构建,不详细说了。需要注意的是,一定要编译INSTALL生产sdk。如果用DX,ogre1.7要用DX比较新的版本,我用的是2010Feb10这个版本,开始装的是2006年的版本,导致RenderSystem_Direct3D9编译不过,所以无法编译过INSTALL。
(三)构建Ogitor工程
1.环境变量中加入刚ogre编好的sdk路径:OGRE_CTHUGHA--->E:/ogresrc/ogre_src_v1-7-1/project/sdk(我的路径是)
2.环境变量中加入刚ogre编好的sdk路径:OGRE_BYATIS--->E:/ogresrc/ogre_src_v1-7-1/project/sdk(我也不知道为什么要加2个一样的路径到两个变量中)。
3.重启,本来可以用命令直接使环境变量生效,命令不记得了,直接重启。
4.CMAKE构建,完成
其实主要也就是参照官方做的,只不过刚开始没看得很明白。。。下面是官方原版过程:
Qt Toolkit
Lucky Visual Studio 2008 users can grab a precompiled package here:
http://qt.nokia.com/downloads/windows-cpp-vs2008
Other versions of Visual Studio: You need to compile Qt yourself, unfortunately.
Using the MinGW based SDK won't do. Sorry.
You don't need to build the OpenGL parts of Qt, as Ogitor is not using any of it.
Be sure to add bin to your PATH.
And a QTDIR environment variable needs to be set to the Qt root directory:
setx QTDIR
To compile Qt from source:
- Open a Visual Studio command prompt and navigate to your Qt source.
- Run configure -platform win32-msvc2008 -nomake demos -nomake examples -no-opengl -no-qt3support. (Change platform to whatever compiler you are using).
- Run nmake.
Ogre
Ogitor stable (v0-4) depends on Ogre 1.7.x (Cthugha).
Ogitor unstable (development) depends on Ogre 1.8.x (Byatis - Ogre unstable)
If you compiled Ogre from source, be sure to build the INSTALL project.
Ogitor v0-4
You need to add an OGRE_CTHUGHA environment variable:
setx OGRE_CTHUGHA <ogre_directory> /sdk
Ogitor development
You need to add an OGRE_BYATIS environment variable:
setx OGRE_BYATIS <ogre_directory> /sdk
Boost:
Ogitor development is using Boost Regex.
Mercurial
Ogre is using Mercurial for source control.
The easiest route is to install TortoiseHg
Ogitor sources
Get the source from: http://hg.ogitor.org/v0-4 (current stable) or http://hg.ogitor.org/development (unstable)
If you're using TortoiseHg: right-click somewhere and clone http://hg.ogitor.org/v0-4 / http://hg.ogitor.org/v0-4
Or, using the command-line:
hg clone http://hg.ogitor.org/v0-4 ogitor for stable Ogitor.
hg clone http://hg.ogitor.org/development ogitor for unstable Ogitor.
CMake
Get and install CMake 2.8 from cmake.org, if you haven't got it already due to it being the official build system of Ogre.
Building Ogitor
- Run cmake-gui.
Choose the Ogitor source directory and a build directory.
The build directory should be different from you source directory.
Click the 'configure' button. - After choosing your build environment, you'll see red CMake entries.
Click the configure button one more time, and examine the results.
If everything look alright, click the generate button.
Close CMake GUI. - Find your build directory and open the Ogitor solution.