Изменить переменную пути к файлу в vs2010 - PullRequest
0 голосов
/ 22 апреля 2011

Я хочу изменить переменную $(something) в VS2010. Я не могу за всю жизнь найти, где определены эти $(something) переменные.

Для курьезов это потому, что я компилирую libpng и мне нужно изменить $(ZLibSrcDir), чтобы он указывал на то, где находится мой zlib. Я знаю, что мог бы просто поставить его там, где он ожидает, но я хотел бы знать, как изменить эти переменные.

Ответы [ 2 ]

4 голосов
/ 25 апреля 2011

Ответ, который я искал, - отредактировать страницу свойств. Это таблица свойств zlib.props, которая поставляется с последним источником libpng. Он находится в той же папке, что и файл .sln.

<?xml version="1.0" encoding="utf-8"?>
<!--
 * zlib.props - location of zlib source
 *
 * libpng version 1.5.2 - March 31, 2011
 *
 * Copyright (c) 1998-2010 Glenn Randers-Pehrson
 *
 * This code is released under the libpng license.
 * For conditions of distribution and use, see the disclaimer
 * and license in png.h

 * You must edit this file to record the location of the zlib
 * source code.
 -->

<Project ToolsVersion="4.0"
   xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Label="Globals">
    <!-- Place the name of the directory containing the source of zlib used for
     debugging in this property.
         The directory need only contain the '.c' and '.h' files from the
     source.
     If you use a relative directory name (as below) then it must be
     relative to the project directories; these are one level deepers than
     the directories containing this file.
     -->
    <ZLibSrcDir>..\..\..\..\zlib</ZLibSrcDir>
  </PropertyGroup>
</Project>

Это очень хорошо прокомментировано:)

0 голосов
/ 22 апреля 2011

Создать переменную среды %ZLibSrcDir%, указывающую, где вам нужно.

My Computer -> Properties -> Advanced -> Environment Variables

Почему бы и нет?

...