Customize vs 2010 build settings using visual studio's macros and customized macros

本文介绍了如何利用Visual Studio宏来管理大型项目中debug和release模式以及win32和x64平台的组合,通过配置解决方案目录、项目目录、平台和配置来指导Visual Studio如何存放编译文件和输出文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

When projects become larger and larger, managing the debug/release win32/win64 combinations may become a mess. It might be time to take some effort to reorganize the projects. Using the visual studio's macros may help to organize your complex projects.


Some important macros:

$(Configuration): debug or release

$(Platform): win32 or x64

$(SolutionDir): solution directory

$(ProjectDir): project directory

$(IntDir): intermediate files directory

$(OutDir): output files directory


more information see: http://msdn.microsoft.com/en-us/library/c02as0cs.aspx


Generally we uses $(SolutionDir), $(ProjectDir), $(platform), $(Configuration) to form the $(IntDir) and $(Outdir) to instruct the visual studio where to put the compiled files and output files.


We may need to customize some macros to record the Include path and library path. To do that, first click the property page tab, and go to the project and right click to select Add new property sheet. Click Use macros and add your define variables for example: $(MyLibDir)  c:\mylib\$(Platform) and add them into the environment. Add the property sheet to all projects in your solution and you can use these macros the same as the system macros.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值