在vs2010中更改文件路径变量

时间:2011-04-22 14:38:42

标签: windows visual-studio visual-studio-2010 path environment-variables

我希望在VS2010中更改$(something)变量。我不能为我的生活找到定义这些$(something)变量的地方。

对于古玩这是因为我正在编译libpng并需要更改$(ZLibSrcDir)所以它指向我的zlib所在的位置。我知道我可以把它放在预期的位置,但我想知道如何更改这些变量。

2 个答案:

答案 0 :(得分:4)

我正在寻找的答案是编辑属性表。这是最新的libpng源附带的属性表zlib.props。它与.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>

评论很好:)

答案 1 :(得分:0)

创建指向所需位置的环境变量%ZLibSrcDir%

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

为什么不呢?