组织外部库的编译器依赖路径
在我当前的团队中,我们在项目设置中组织对外部库标头的依赖关系,如下所示:
编译器设置->其他包含:
d:\src\lib\boost_1_43
d:\src\lib\CxImage_6_00
...
如您所见,我们在路径中包含了确切的库版本号。
这种方法的优点是我们始终知道当前项目中使用了哪个库的确切版本。由于项目设置存储在我们的存储库中,我们还拥有这些设置的完整历史记录。如果版本发生变化,负责的开发人员必须更改项目设置并确保新版本没有问题。
我看到的最大缺点是,对于库的每个新版本,我们都必须接触使用它的每个项目,并更改路径。 (我们不想在我们的主要产品中部署一个库的多个版本)。我可以看出,您不会通过这个重复的过程结交很多朋友...
您如何在中型项目中处理这个问题?
根据您的经验,有“最佳实践”吗?
我对包含大量子项目的 Windows/Visual Studio 2008 环境中的任何解决方案特别感兴趣。
感谢您的任何建议!
I my current team we organize the dependencies to external libraries headers in the project settings like that:
Compiler Settings->Additional Includes:
d:\src\lib\boost_1_43
d:\src\lib\CxImage_6_00
...
As you can see, we include the exact library version number in our paths.
The advantage
of this method is that we always know, which exact version of an library is used in the current project. Since the project settings are stored in our repository we also have a complete history of those settings. If there is a version change, the responsible developer has to change the project settings and make sure there are no issues with the new release.
The big disadvantage
I see is that with every new version of a library, we have to touch every project that uses it, and change the paths. (We don't want to deploy several versions of one library with our main product). And I can tell, you don't make a lot of friends with this reocurring process...
How do you handle this issue in your medium sized project?
Is there a 'best practice' in your experience?
I'm specially interested in any solutions in a windows/visual studio 2008 environment having a lot of subprojects.
Thanks for any advice!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用属性表来管理轻松地使用常见的项目属性。
我的建议是设置用户宏,组织如下:
然后,在项目属性中,您只需要引用
$(BoostPath)
和$(CxImagePath)
而不是特定版本。您可以移动整个依赖项文件夹,并且只需更改属性表中的各种宏即可更改各个依赖项路径。You can use property sheets to manage common project properties easily.
My suggestion would be to set up user macros organized something like so:
Then, in your project properties, you only need to refer to
$(BoostPath)
and$(CxImagePath)
and not to specific versions. You can move the entire dependencies folder and you can change individual dependency paths simply by changing the various macros in the property sheet.