Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio - Where to define custom path macros?

I just opened someone else's Visual Studio project and in their build properties they have a few custom path macro's they are using for their include and lib directories. The macro names are things like this:

$(MY_WHATEVER_INCLUDE_DIR)

I could manually replace every single macro with the real path, but it would be nice to just use the macros. My question is, where do I define these custom path macros at?

like image 527
Jake Wilson Avatar asked Jan 17 '11 04:01

Jake Wilson


People also ask

Where are macros defined visual studio?

View the current properties and macrosSelect Edit and then in the Edit dialog box, choose the Macros button. The current set of properties and macros visible to Visual Studio is listed along with the current value for each.

How do I create a macro in Visual Studio?

Open a project in the editor and run the macros by right clicking and choosing Run. Right clicking on the macro and choosing Edit brings up the Visual Studio Macro editor. You can either create new modules, macros or edit existing ones.


2 Answers

This link http://msdn.microsoft.com/en-us/library/a2zdt10t(v=vs.90).aspx could interest you. I didn't like the idea of changing my whole system configuration just to build a project. The most interesting part on the page is the last comment :

This page fails to mention how to get to this dialog:

From Property Manager, double click on a property page. Click on "User Macros" under "Common Properties" in the tree control.

like image 127
gregseth Avatar answered Sep 20 '22 06:09

gregseth


Here the approach is described with pictures: https://sites.google.com/site/pinyotae/Home/visual-studio-visual-c/create-user-defined-environment-variables-macros

In Visual Studio you need to:

  1. Click in the main menu "View", then "Property Manager"
  2. Right-click in the empty space of "Property Manager" window and in the pop-up menu click "Add New Project Property Sheet"
  3. After adding the property sheet, double click it in the Property Manager window and in the tree on the left select property page "User Macros"
  4. Then you can click "Add Macro" button

Here is a tutorial on Project Property Sheets: http://www.dorodnic.com/blog/2014/03/20/visual-studio-macros/

like image 42
Serge Rogatch Avatar answered Sep 20 '22 06:09

Serge Rogatch