用MinGW编译Ogre-1.7.1

9 篇文章 0 订阅
2 篇文章 0 订阅

How to Build Ogre-1.7.1 with MinGW

1. Download
http://bitbucket.org/sinbad/ogre
Use TortoiseHg to clone source repository to D:/prj/ogre.
http://www.ogre3d.org/download/source
Get MinGW Precompiled Dependencies.
http://www.cmake.org/cmake/resources/software.html
Get CMake installer (cmake-*-win32-x86.exe).
http://www.boost.org
Get Boost.
http://www.microsoft.com/downloads/en/resultsForCategory.aspx?categoryid=2
Get latest DirectX SDK.
http://www.doxygen.org
Get Doxygen installer.
http://www.graphviz.org
Get Graphviz installer.
http://freeimage.sourceforge.net/download.html
Get FreeImage source.

2. Prepare
. Install DXSDK, Doxygen, Graphviz.
. Build and install Boost to C:/boost.
. Clone a working copy to D:/prj/ogre/v1-7.
D:
hg clone /prj/ogre/ogre /prj/ogre/v1-7
cd /prj/ogre/v1-7
. Import patches if necessary, using "hg import path_to_patch_file".
. Create a build directory.
mkdir /prj/ogre/build-ogre-1.7
. Unpack MinGW precompiled dependencies, i.e. OgreDependencies_MinGW_20100216.zip, to /prj/ogre/build-ogre-1.7.
///
Optional:
#if 0
. Remove *FreeImage* files under D:/prj/ogre/build-ogre-1.7/Dependecies.
. Unpack FreeImage source to D:/prj.
. Build as static library, copy files to dependency directories:
D:
cd /prj/FreeImage
set FREEIMAGE_LIBRARY_TYPE=STATIC
make -j3 >build.log 2>&1
copy Dist/FreeImage.h /prj/ogre/build-ogre-1.7/Dependencies/include/
copy Dist/FreeImage.a /prj/ogre/build-ogre-1.7/Dependencies/lib/Release/
copy Dist/FreeImage.a /prj/ogre/build-ogre-1.7/Dependencies/lib/Debug/
#endif
///

3. Run CMake
. Set "Where is the source code:" to "D:/prj/ogre/v1-7".
. Set "Where to build the binaries:" to "D:/prj/ogre/build-ogre-1.7".
. Click "Configure" button.
. Choose "Eclipse CDT4 - MinGW Makefiles", or "MinGW Makefiles" w/o Eclipse.
. Choose "Use default native compilers".
. Click "Finish" button.
. Switch to "Advanced View", set CMake entries values:
CMAKE_MAKE_PROGRAM:FILEPATH=make
CMAKE_SH:FILEPATH=cmd.exe
CMAKE_USE_RELATIVE_PATHS:BOOL=ON
. Click "Configure" button.
. Verify/modify the following entries:
Boost_INCLUDE_DIR:PATH=C:/boost/include (default)
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo (default)
CMAKE_ECLIPSE_EXECUTABLE:FILEPATH=C:/Program Files/eclipse/eclipse.exe (if w/ Eclipse)
///
Optional:
#if 0
CMAKE_EXE_LINKER_FLAGS:STRING=-Wl,--enable-auto-import
CMAKE_MODULE_LINKER_FLAGS:STRING=-Wl,--enable-auto-import
CMAKE_SHARED_LINKER_FLAGS:STRING=-Wl,--enable-auto-import
#endif
///
CMAKE_VERBOSE_MAKEFILE:BOOL=ON
OGRE_DEPENDENCIES_DIR:PATH=D:/prj/ogre/build-ogre-1.7/Dependencies
OGRE_INSTALL_DOCS:BOOL=ON (optional if Doxygen installed)
OGRE_INSTALL_SAMPLES:BOOL=ON
ZLIB_LIBRARY_DBG:FILEPATH=D:/prj/ogre/build-ogre-1.7/Dependencies/lib/debug/libzlibd.a
ZLIB_LIBRARY_REL:FILEPATH=D:/prj/ogre/build-ogre-1.7/Dependencies/lib/release/libzlib.a
. Click "Configure" button.
. Click "Generate" button.

4. Compile
D:
cd /prj/ogre/build-ogre-1.7
set LANG=en_US
make -j3 install >build.log 2>&1
copy C:/boost/lib/libboost_thread-*mt.dll /prj/ogre/build-ogre-1.7/sdk/bin/relwithdebinfo/
. Now Ogre SDK in D:/prj/ogre/build-ogre-1.7/sdk.

4. Reference
http://www.ogre3d.org/wiki/index.php/Building_With_CMake

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值