How to add custom variable to c++ project

  • Thread starter Thread starter Pavel A.
  • Start date Start date
P

Pavel A.

There are many predefined variables in a VC++ project properties
like $(DevEnvDir), $(TargetName) etc.
I'd like to add my custom variable to the project or solution (to share
among several projects).

Example: path or parameters of a custom libraries, sources or tools.

Is this possible? How?

Defining global environment variables is not a good solution, because
I want these variables be *local in a project*.

Regards,
--PA
 
Pavel A. said:
There are many predefined variables in a VC++ project properties
like $(DevEnvDir), $(TargetName) etc.
I'd like to add my custom variable to the project or solution (to share
among several projects).

Example: path or parameters of a custom libraries, sources or tools.

Is this possible? How?

Defining global environment variables is not a good solution, because
I want these variables be *local in a project*.

Regards,
--PA
Write a small class and declare your variables as public static, then add
the class to any project where you want the variable?
 
Pavel said:
There are many predefined variables in a VC++ project properties
like $(DevEnvDir), $(TargetName) etc.
I'd like to add my custom variable to the project or solution (to
share among several projects).

Example: path or parameters of a custom libraries, sources or tools.

Is this possible? How?

Defining global environment variables is not a good solution, because
I want these variables be *local in a project*.

Environment variables are per-process, the trick is getting them
automatically set in Visual Studio.

I've used
http://www.workspacewhiz.com/OtherAddins.html#SolutionBuildEnvironment for
that purpose.
 
Back
Top