Ogre手动编译

来源:互联网 发布:网络写手如何取名 编辑:程序博客网 时间:2024/05/20 18:00

网上很多讲的个人感觉一般,我在这里总结一下,完全可以用的

vs版本 vs2013(这个都可以通过其他的应该更加没问题了吧)

 

我觉得有必要翻译一下,各位也有必要按着ogre官网的方法编译源代码,而不是直接下载srccode,通过下面这种方法,能够在每次OGRE更新的时候利用Mercurial更新需要更新的,而且相应的能够更新Dependencies,如果你不用这种方法,那就要匹配srccode和Dependencies的版本,否则极易出现编译不过的情况。可能没编过的有点懵了,废话不多说

Mercurial(版本管理软件,没必要深究)

There are two ways you can get hold of the OGRE source: download a stable release, or retrieve a development version through Mercurial.

有两种方法获得OGRE的源代码,一种是直接下载,另一种是通过Mercurial获得

The source code to OGRE is held in a central repository hosted by BitBucket, which is accessible by anyone with a Mercurial compatible tool (although only registered developers can push changesets to it). If you don’t know what Mercurial is, you should visit their website for more information, but it’s a Distributed Version Control System (DVCS), which means it’s a place where a versioned history of source code can be held, and downloaded by others. You can download the command line tool (’hg’) for your platform, or if you prefer there are graphical tools like TortoiseHg. You can even browse the repository without downloading it if you wish, or see the latest commits at CIA.vc.

ogre的源代码全部放在数据仓库中(BitBucket中),可以通过Mercurial获得(只有注册用户才能推送更改),如果你不知道Mercurial是什么,你可以去他们的网站以便获取更多信息,Mercurial是一个版本控制软件,意味着你可以获得任意版本的源代码,你可以使用命令行直接操作Mercuria,也可以通过比较友好的界面工具操作Mercurial例如TortoiseHg.

 

Note: In order to compile the OGRE source, you will need to compile the OGRE dependencies first. Those will then later get picked up by CMake when building OGRE itself.

      注意:为了编译OGRE源代码,你应该首先编译OGRE dependencies ,当编译OGRE时CMake会用到他们

 

把以上两段查找出来就是为了大家能够按着版本控制的方法,获取OGRE源代码,以及OGRE dependencies

1.工具下载:

Mercurial  http://mercurial.selenic.com/ 下载那个不带py字样的,带py的需要安装python

测试安装是否成功 打开cmd  输入 hg version如果成功了 会显示版本号等

CMake :这个应该下载新一点的应该

2.下载代码:

OGRE:

如果你没有下载过,通过cmd调整到你想放置源代码的文件夹,输入以下命令

hg clone http://bitbucket.org/sinbad/ogre/ -u v1-9

如果你以前已经下载过,通过cmd调整到你文件夹所在位置,输入以下命令

hg update v1-9(因为已经存在 使用更新命令就可以了)

注意:版本是不断在更新的,不能永远v 1-9,至于具体多少版本,查看ogre官网就可以了

 DEPENDENCIES:

输入

hg clone https://bitbucket.org/cabalistic/ogredeps

 

3.编译:

编译DEPENDENCIES:

打开cmake

while is the source code:你ogredeps的目录(例D:\pzjwork\ogredeps)

where to build the binaries:这个你自己随意设置,可以和上面的目录重合(但是不建议,假如将来有更新的话,你的那些sln解决方案就没有任何意义了)

首次点击CONFIGURE,选择你要生成哪个版本的解决方案 vs2008  vs2010等等,只要CMAKE支持

接下来点击Generate

然后在build目录就应该有解决方案了,然后F7编译,再单独生成一遍INSTALL一遍

注意:debug和release各生成一遍

这些步骤结束之后,你会在where to build the binaries这个目录下发现一个ogredeps目录,里面有bin include lib三个目录

编译OGRE

while is the source code:你ogredeps的目录(例D:\pzjwork\ogredeps)

where to build the binaries:这个你自己随意设置(在这个目录下创建一个Dependencies文件夹,将上面的 bin include lib目录拷贝至此目录下)

然后不停的CONFIGURE 然后gengerate

这样就生成了相应vs版本的解决方案

注意:我在编译的时候提示找不到FreeImaged.lib等,这个是因为在编译DEPENDENCIES时,产生的文件名称是FreeImage_d.lib,将名称改过来就可以了,编译OGRE和DEPENDENCIES时一定要使用一致的vs版本,否则可能编译通不过

2013-12-5完成全部编译,全部成功对应的lib文件名称应该改为(cg.lib; FreeImaged.lib ;freetype2311_d.lib ;OIS_d.lib ; zlibd.lib; zziplibd.lib )

4:Mercurial的使用:

这个其实只要掌握基本的命令即可,甚至你只需要按照OGRE官网的命令来就可以了

0 0
原创粉丝点击