C ++ Buildsystem具有预先编译依赖关系的能力 [英] C++ Buildsystem with ability to compile dependencies beforehand

查看:207
本文介绍了C ++ Buildsystem具有预先编译依赖关系的能力的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一个c ++游戏项目设置一个构建环境。我们的主要要求是不仅能够构建我们的游戏代码,还能够构建其依赖关系(Ogre3D,Cegui,boost等)。此外,我们希望能够在Linux和Windows上构建,因为我们的开发团队由使用不同操作系统的成员组成。

I'm in the middle of setting up an build environment for a c++ game project. Our main requirement is the ability to build not just our game code, but also its dependencies (Ogre3D, Cegui, boost, etc.). Furthermore we would like to be able build on Linux as well as on Windows as our development team consists of members using different operating systems.

Ogre3D使用 CMake 作为其构建工具。这就是为什么我们基于我们的项目CMake太远了。我们可以编译完全良好,一旦所有依赖关系设置在每个团队成员系统上,因为CMake能够找到库。

Ogre3D uses CMake as its build tool. This is why we based our project on CMake too so far. We can compile perfectly fine once all dependencies are set up manually on each team members system as CMake is able to find the libraries.

问题是如果有一个可行的方法以自动设置依赖关系。作为Java开发人员,我知道Maven,但是在c ++的世界中存在什么工具?

The Question is if there is an feasible way to get the dependencies set up automatically. As a Java developer I know of Maven, but what tools do exist in the world of c++?

:感谢您的答复和链接。在接下来的几天里,我将尝试一些工具来看看什么符合我们的要求,从CMake开始。我真的有我的自动工具我迄今为止和我喜欢的文档(autobook是一个非常好的阅读),我害怕自动工具不是意味着在Windows本机上使用。

Update: Thanks for the nice answers and links. Over the next few days I will be trying out some of the tools to see what meets our requirements, starting with CMake. I've indeed had my share with autotools so far and as much as I like the documentation (the autobook is a very good read), I fear autotools are not meant to be used on Windows natively.

有些人建议让一些IDE处理依赖关系管理。我们包括使用所有可能的技术的代码从纯Vim到完全烧写的Eclipse CDT或Visual Studio的个人。这是CMake允许使用一些灵活性,并具有生成本机项目文件的能力。

Some of you suggested to let some IDE handle the dependency management. We consist of individuals using all possible technologies to code from pure Vim to fully blown Eclipse CDT or Visual Studio. This is where CMake allows use some flexibility with its ability to generate native project files.

推荐答案

在最新的CMake 2.8版本中有一个新的 ExternalProject 模块。
这允许下载/检出代码,配置和构建它作为主构建树的一部分。
它还应该允许设置依赖关系。

In the latest CMake 2.8 version there is the new ExternalProject module. This allows to download/checkout code, configure and build it as part of your main build tree. It should also allow to set dependencies.

在我的工作(医学图像处理组)中,我们使用CMake来构建我们自己的库和应用程序。我们有一个内部工具来跟踪项目之间的所有依赖(在XML数据库中定义)。大多数第三方库(如Boost,Qt,VTK,ITK等)为我们支持的每个系统(MSWin32,MSWin64,Linux32等)构建一次,并在版本控制系统中作为zip文件提交。 CMake然后将根据开发人员正在使用的系统提取并配置正确的zip文件。

At my work (medical image processing group) we use CMake to build all our own libraries and applications. We have an in-house tool to track all the dependencies between projects (defined in a XML database). Most of the third party libraries (like Boost, Qt, VTK, ITK etc..) are build once for each system we support (MSWin32, MSWin64, Linux32 etc..) and are commited as zip-files in the version control system. CMake will then extract and configure the correct zip file depending on which system the developer is working on.

这篇关于C ++ Buildsystem具有预先编译依赖关系的能力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆