更改vs2010中的文件路径变量

发布于 2024-11-03 07:29:08 字数 204 浏览 1 评论 0原文

我希望更改 VS2010 中的 $(something) 变量。我一生都无法找到这些 $(something) 变量的定义位置。

对于好奇心来说,这是因为我正在编译 libpng 并且需要更改 $(ZLibSrcDir) 以便它指向我的 zlib 所在的位置。我知道我可以把它放在它期望的地方,但我仍然想知道如何更改这些变量。

I wish to change a $(something) variable in VS2010. I cannot for the life of me find where these $(something) variables are defined.

For the curios it is because I am compiling libpng and need to change $(ZLibSrcDir) so it points to where my zlib is. I know I could just put it where it expects it, but I would like to know how to change these variables none the less.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

2024-11-10 07:29:08

我正在寻找的答案是编辑属性表。这是最新 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>

评论得很好:)

The answer I was looking for was to edit the property sheet. This is the property sheet zlib.props that comes with the latest libpng source. It is in the same folder as the .sln file.

<?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>

It is very well commented :)

混吃等死 2024-11-10 07:29:08

创建环境变量 %ZLibSrcDir% 指向您需要的位置。

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

为什么不呢?

Create environment variable %ZLibSrcDir% pointing where you need.

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

Why not?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文