OGRE 1.7.1 CMAKE 编译

Posted on 2010-12-02 00:02 小火球 阅读(2256) 评论(0)  编辑 收藏 引用 所属分类: Other

关于ogre 1.7.1的下载、配置和编译指南

OGRE从1.7开始使用Cmake生成工程文件,这很方便的实现跨平台项目的移植,今天来说说生成过程中的小细节。
1、ogre_src_v1-7-1.exe:https://sourceforge.net/projects/ogre/files/ogre/1.7/ogre_src_v1-7-1.exe/download

2、Microsoft Visual C++ Dependencies Package:http://sourceforge.net/projects/ogre/files/ogre-dependencies-vc%2B%2B/1.7/OgreDependencies_MSVC_20100501.zip/download

3、cmake-2.8.1-win32-x86.exe:http://www.cmake.org/cmake/resources/software.html

下载完后,解压ogre到你的目录(例如:E:/GAME_SDK/ogre_src_v1-7-1),解压Dependencies到Ogre目录下(即,E:/GAME_SDK/ogre_src_v1-7-1/Dependencies),安装CMake2.8.1;

打开CMake,在Where is the source code处填入E:/GAME_SDK/ogre_src_v1-7-1,在Where to build the binaries处填入要生成的工程目录,方便区分我新建文件夹E:/GAME_SDK/Ogre_SDK

点击“Configure”按钮,弹出的窗口选择开发环境,我选择VS2008(VC9),CMake开始检测并生成工程文件,满以为一路顺利的,呵呵,出错了吧!


分析日志:
CMake Error at CMake/Utils/MacroLogFeature.cmake:100 (MESSAGE):

-----------------------------------------------------------------------------

-- The following REQUIRED packages could NOT be located on your system.
   -- Please install them before continuing this software installation.
   -- If you are in Windows, try passing -DOGRE_DEPENDENCIES_DIR=<path to
dependencies>
-----------------------------------------------------------------------------
+ freetype: Portable font engine <http://www.freetype.org>  
-----------------------------------------------------------------------------
Call Stack (most recent call first):
CMake/Dependencies.cmake:203 (MACRO_DISPLAY_FEATURE_LOG)
CMakeLists.txt:157 (include)

好,按照指示手动指定DOGRE_DEPENDENCIES_DIR的路径,再Configure,错误依然,百度一下,原来是没有预先编译/Dependencies里的工程,导致Cmake找不到freetype相应的库文件;那好先用VS把Dependencies目录下的各种依赖包编译好,再CMale生成~~~呵呵,项目顺利生成~~~


上面的红色表示第一次生成,确认配置更改好后,再点击"Config",倘若输出窗口没有报错,最后点击"Generate"即可,到底如何,看看目录下有没有:

posts - 28, comments - 3, trackbacks - 0, articles - 0

Copyright © 小火球