Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add environmental variable to VS solution (.sln )

I need to have my own environmental variable (like $(VsInstallDir) ) for all projects in solution. How can i define it in my solution ?

I'm using VS2008, C++ solution

like image 731
user68416 Avatar asked Mar 11 '09 13:03

user68416


1 Answers

I had a similar problem and consequent question. Take a look at the answers there. The short answer is: use property sheets.

For example:

<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
    ProjectType="Visual C++"
    Version="8.00"
    Name="MyIncludes"
    >
    <UserMacro
        Name="BoostInclude"
        Value="C:\Program Files\boost\boost_1_35_0"
        PerformEnvironmentSet="true"
    />
</VisualStudioPropertySheet>
like image 57
Dani van der Meer Avatar answered Nov 10 '22 16:11

Dani van der Meer