主要参考http://www.ogre3d.org/tikiwiki/tiki-index.php?page=Home中的系列文章。
安装平台:
Ubuntu12.04
cmake version 2.8.7
gcc (Ubuntu/Linaro 4.7.3-2ubuntu1~12.04) 4.7.3
ogre_src_v1-9-0RC1.tar.bz2
我采用的是从源码编译方式来创建OGRE。
一、安装一些依赖包。
在ubuntu下执行下列命令(参考文章http://www.ogre3d.org/tikiwiki/tiki-index.php?page=Prerequisites&tikiversion=Linux):
For Ubuntu Karmic and above:
Compiler And Configuration Tools
sudo apt-get install build-essential automake libtool
Required Dependencies
sudo apt-get install libfreetype6-dev libfreeimage-dev libzzip-dev libxrandr-dev libxaw7-dev freeglut3-dev libgl1-mesa-dev libglu1-mesa-dev
If during Ogre build any headers are still missing, try adding these one at a time, and update the list above please!
libxt-dev
libpng3-dev
Could probably use
libglew1.5-dev
instead of
freeglut3-dev
. It is an open question whether or not
libxt-dev
and
libpng3-dev
is required.
Not Strictly Required Dependencies
sudo apt-get install nvidia-cg-toolkit libois-dev libboost-thread-dev
While
nvidia-cg-toolkit
,
libois-dev
and
libboost-thread-dev
are not strictly required, you'll want to install them:
nvidia-cg-toolkit is used by the Cg plugin for Cg shaders.
libois-dev is used as input library for the demos.
libboost-thread-dev is used by the paging component and other background threading.
Entirely Optional Dependencies
sudo apt-get install doxygen graphviz libcppunit-dev
二、编译下载的OGRE源码
执行下列命令(参考文章http://www.ogre3d.org/tikiwiki/tiki-index.php?page=CMake+Quick+Start+Guide&tikiversion=Linux):
Download Ogre Source
(Instructions below assume current version of 1.8.0, update as needed)
Decompress:
tar xjf ogre_src_v1-8-0.tar.bz2
Move to source directory:
cd ogre_src_v1-8-0
Create build directory:
mkdir build
Move into build directory:
cd build
Trigger cmake, passing path to Ogre source directory:
cmake .. See the Extensive CMake page for a list of compilation options which can be passed to CMake at this stage, and Getting Started With CMake for even more background material. N.B. Please note that OGRE_CONFIG_THREADS = 1 is not supported on Linux.
If the CMake results look good, build Ogre:
make -j2 The -j2 specifies how many parallel compilation jobs to run. Substitute the number of processor cores on your system, e.g. -j2 for a dual-core, -j4 for a quad core...
Once compilation is successful, you can install into the system (by default, /usr/local):
sudo make install 三、测试
参考文章Building Your Projects With CMake(http://www.ogre3d.org/tikiwiki/tiki-index.php?page=Building+Your+Projects+With+CMake):
详细的就不说了,一步步按照文章说明来做即可。