Using Visual Studio project properties effectivly for multiple projects and configurations?

I just found out somthing I didn't think was possible (it is not exposed by the GUI) that helps make property sheet far more useful. The "Condition" attribute of many of the tags in the project property files and it can be used in the . Props files as well!

I just found out somthing I didn't think was possible (it is not exposed by the GUI) that helps make property sheet far more useful. The "Condition" attribute of many of the tags in the project property files and it can be used in the . Props files as well!

I just put together the following as a test and it worked great and did the task of 5 (common,x64,x86,debug,release) separate property sheets! -d x86 x64 vc90 vc100 $(ProjectName)-$(Toolset)-$(ShortPlatform)$(DebugSuffix) Only issue is the properties GUI cant handle it, a project that uses the above property sheet just reports default inherited values like "$(ProjectName)" for the target.

Nice technique! – Mordachai Jan 4 at 20:59 +1 this is very similar to what I use – AJG85 Jan 7 at 15:53 Yeah, property sheets are far more powerful in VS2k10. Just a shame none of it is exposed through the IDE.

I've done something similar and it really simplifies things. – jalf Jan 7 at 18:35.

I just filed a Connect bug for making conditions configurable via the GUI. Vote for it! Https://connect.microsoft.Com/VisualStudio/feedback/details/634614.

1 added my vote for this as well. – Mordachai Jan 4 at 20:59.

I had same pain for the product of my company (200+ projects) before. The way I solved it is to build a nice hierarchy of the property sheets. The projects inherits the property sheet by its output type, say x64.Debug.Dynamic.Library.vsprops.

This vsprops file simply inherits other property sheets using the InheritedPropertySheets attribute You can also use variables (i.e. UserMacro, whose value can be absolute or even environment variables) in property sheets to customize a lot of things based on your need. For example, defining a BIN variable in Debug.

Vsprops then when you set the output name in the series of vsprops, say, Output. X64.Library. Vsprops The $(BIN) variable will be expanded to what's been set (in this case, Debug).

Use this technique you can easily construct a nice hierarchy of property sheets to meet your demand. Now there's one more thing you might want to do: build your own project templates that uses your property sheet set. The real difficult part is to enforce proper usage of the templates and property sheets.My personal experience is that even if everything is setup, somebody will still forget to use the template to create new projects ...

As far as the output library goes, you can select all your projects, then bring up the property pages, select All Configurations, All Platforms and then set the Target Name to: $(ProjectName)-$(PlatformToolset)-$(PlatformShortName)-$(Configuration) which would give an output like mylib-v100-x86-Debug. Lib We do something similar to this for Additional Library Directories as well, using $(PlatformName) and #(Configuration) to pick out the right library paths, although it does mean some messing around with initial setup of the libraries. Eg we have boost install its libs to boost/lib.

Win32 or boost/lib. X64. With regards to libraries, and people installing them in different places, there are a couple of options.

If you have a very robust source control system, you can just put everything in source control, living in a libs folder next to your source. That probably won't work if you use more than a few libraries though, or if they are particularly large. The other option that comes to mind is to set an environment variable on each user machine that points to the root of their libraries folder, eg LIB_ROOT=c:\libraries, and you can then access that in Visual Studio as $(LIB_ROOT).

I have already done some bits like this a bit, but then there is libraries that use something else in their names (eg opt instead of release, -d instead of -Debug) etc, which still requires a lot of special rules (my debug. Props and release. Props set up user macros to help with this with common.

Props actually setting the include/lib paths). Hadn't considered it with boost, good idea (be even nicer if there auto-linking included not using the same names for x86 and x64 builds but the boost. Build people don't seem to think its an issue) – Fire Lancer Aug 17 '10 at 13:09 I guess your PlatformShortName came from a x86.

Props and x64. Props that must be correctly inherited or something or is it just undocumented? – Fire Lancer Aug 17 '10 at 13:12 @Fire Lancer: to be honest I'm not sure where PlatformShortName is coming from.

I think it must be a built-in, because we don't have anything special in our property sheets. – ngoozeff Aug 17 '10 at 13:29.

I made some improvements, may be useful for somebody $(System. Convert::ToString( $(System.Text. RegularExpressions.

Regex::IsMatch($(Configuration), 'Ddebug')))) x86 x64 $(registry:HKEY_CURRENT_USER\Software\MyCompany\@BUILD_DIR) Debug -d Release $(BUILD_DIR)\Bin\$(MyOutDirBase)_$(ShortPlatform)\ $(BUILD_DIR)\Build\$(Configuration)_$(ShortPlatform)_$(PlatformToolset)\$(ProjectGuid)\ $(SolutionDir)\Bin\$(MyOutDirBase)_$(ShortPlatform)\ $(SolutionDir)\Build\$(Configuration)_$(ShortPlatform)_$(PlatformToolset)\$(ProjectGuid)\ $(MyOutDir) $(MyIntDir) have fun!

It sounds like it could be worth checking out a build tool - at my place we use a custom made tool that watches files and projects for changes and figures the dependencies and compile order. Adding a new file is no big deal - compilation is done with msbuild. If I had to compile more than a bunch of projects I would use something like nant: nant.sourceforge.net.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions