3

Is it possible to lower case environment variables from Visual C++ project settings e.g. $(TargetName), $(ConfigurationName) etc without having to specify these as new environment variables. I would like to keep everything lower case to match my unix builds.

Thanks

2 Answers2

3

Yes, it is possible!

Just use $(MacroName.toLower()) or $(MacroName.toUpper()).

For example:

$(Configuration) == Debug

$(Configuration.toLower()) == debug

$(Configuration.toUpper()) == DEBUG


This works as of Visual Studio 2017, can't tell if it does for older versions, though.

sunny moon
  • 1,313
  • 3
  • 16
  • 30
0

Here it says:

These macros are not case sensitive.

According to some, $(Target..) is lower case, whereas $(OutputDir) is not necessarely:

However, I don't know about any documentation confirming this.

Community
  • 1
  • 1
c_k
  • 1,746
  • 1
  • 20
  • 35
  • 1
    I am using them as part of the output binary name; they come out with the case preserved which is not what I want, I want them all lowercase. I was hoping there was a function I could run against them to lowercase them or an option. – Grant Rogers Mar 20 '13 at 17:16
  • 2
    I am having the opposite problem to this. Maybe I should be looking in to the equivalent makefile for Visual Studio and see if there are functions I can run in there. Will post up when I look in to this. – Grant Rogers Mar 22 '13 at 09:11