我们如何创建一个仅导出某些文件却什么也不做的.VCXPROJ? [英] How can we create a .VCXPROJ which does nothing but only exports some files?

查看:65
本文介绍了我们如何创建一个仅导出某些文件却什么也不做的.VCXPROJ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

我有一个VC ++解决方案(通过Visual Studio 2010创建).在此代码库中,我有10个项目,构建解决方案后,我得到10个dll作为最终输出.

同样在此代码库中,我有一个名为 3rdparty 的文件夹,其中有一些第三方dll.现在,我的要求是我要导出所有这些dll以及此解决方案生成的10个dll.

问题:
我无法从10个项目中的任何一个导出 3rdparty dll.所以我做了什么,我创建了一个单独的vcxproj(第11个),名为 ThirdPartExporter.vcxproj ,在这里我没有放置任何代码,只是使用了它的 Post Build Events 设置进行复制最终输出文件夹中的所有 3rdparty dll.现在的问题是,即使使用 Rebuild 选项,构建解决方案也永远不会构建该项目.因此,我必须显式重建 ThirdPartExporter.vcxproj ,以便将 3rdparty dll复制到输出文件夹中.因此,我无法导出具有构建后事件设置的 3rdparty dll,因为每次都必须显式重建 ThirdPartExporter.vcxproj .

我想要什么:
我想创建一个没有任何代码的单独的vcxproj.但是,在重建解决方案时,它会将所有dll从 3rdparty 文件夹复制(导出)到最终输出文件夹.

在这方面有人可以帮我吗?

在此先感谢,
Aseem Sharma

Hi friends,

I have a VC++ solution (created through Visual Studio 2010). In this code base, I have 10 projects and after building the solution I get 10 dlls as the final output.

Also in this code base, I have a folder called 3rdparty where I have some third party dlls. Now my requirement is that I want to export all of those dlls along with 10 dlls that this solution produces.

Problem:
I cannot export 3rdparty dlls from any of the 10 projects. So what I did, I created a separate vcxproj (the eleventh one) named ThirdPartExporter.vcxproj where I did not put any code but just used its Post Build Events settings to copy all the 3rdparty dlls in the final output folder. Now, the problem is that building solution never build this project even with Rebuild option. So I have to explicitly rebuild ThirdPartExporter.vcxproj to copy 3rdparty dlls in the output folder. So I cannot export 3rdparty dlls with Post Build Events settings as I have to rebuild ThirdPartExporter.vcxproj explicitly every time.

What I want:
I want to create a separate vcxproj which does not has any code. But while rebuilding the solution it copy (export) all the dlls from 3rdparty folder to the final output folder.

Can anybody help me in this regard?

Thanks in Advance,
Aseem Sharma

推荐答案

添加bat或cmd文件,打开属性,并将构建中排除的项目设置为no,将项目类型设置为自定义构建工具"
将出现自定义构建工具"分支.在命令行中设置"
Add bat or cmd file, open properties and set excluded from build to no, the item type to Custom Build Tool
There will appear Custom Build Tool branch. In the command line set "


(FullPath)".输出设置为.".
在cmd中添加所需的任何命令.
(FullPath)". The output set ".".
In the cmd add any commands you like.


您可能会查看生成后事件" ...您可以使用此命令复制所有DLL和其他文件.

我认为您并不是真的要导出",只是复制到一个公共位置.
You might look into the Post Build events...you can copy all the DLLs and other files you want using this.

I don''t think you really mean "exporting", simply copying to a common location.


这篇关于我们如何创建一个仅导出某些文件却什么也不做的.VCXPROJ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆