Macros for build commands and properties in Visual Studio 11

Three-part question:

  • Are build-time macros fully instantiated in Visual Studio 11?
  • How to edit and define them in the IDE?
  • How can I let macros still matter during a debugging session?

Note that I mean build-time macros , such as $(ProjectDir), rather than IDE macros, used to record a series of keystrokes - they removed them , but I can live without them. I defined my own build-time macros through property pages in Visual Studio 10. For example, I could create a macro to determine where Boost is installed on my local computer with the name $(BoostDir)in x64 assemblies through View> Property Manager> Microsoft.Cpp.x64. user :

macro definitions in VS10

I use this function because I can have (for example) Boost installed in different places on different computers. These properties are machine dependent and are not checked in the source control. Then I can use these macros in the project settings, which are checked for the source control, and it should work on every computer that I compile this project while I defined macros for this machine.

enter image description here

When trying to compile and run my VS10 projects in Visual Studio 11 Developer Preview, I ran into several problems regarding these macros.

First, there is no interface in VS11 for defining these user-defined macros. Where they were in VS10, now there is nothing in VS11:

enter image description here

, Compiler/IDE, , , -.

-, , , , , , . , , DLL VS10, VS11, :

enter image description here

, DLL, VS10 VS11:

enter image description here

... .

, VS10 VS11?

+5
2

, , .

" " > " ".

, , BOOST_VER, , IncludeBoost.props, .

User Macros
Name       Value
BOOST_VER  1.49.0

C/C++ > General > Additional Include Directories >
"$(environment variable)\3rdParty\Boost_$(BOOST_VER)\Boost";%(AdditionalIncludeDirectories)

C/C++ > Preprocessor > Preprocessor Definitions >
BOOST_ALL_DYN_LINK;%(PreprocessorDefinitions)

Linker > General
$(env var)\3rdParty\Boost_$(BOOST_VER)\Boost\lib\$(Platform);%(AdditionalLibraryDirectories)

, (Win32 x64).

BTW, Property Manager Ctrl + click.

.

+1

Microsoft.Cpp.x64.user.props, , , , , % blah%\AppData\Local\Microsoft\MSBuild\v4.0. , VS11 . .

0

All Articles