如何将一个项目的构建文件复制到第二个项目的include/library目录
How do I copy files on build of one project to the include/library directories of a second project?
我有一个MSVC2013解决方案,其中有两个项目,一个用于DLL
库,另一个用于测试库的可执行文件。我的文件夹结构是:
SolutionDir
|-- DLL
| `-- src
|-- Executable
| `-- src
|-- .libs
| |-- DLL
| | |-- include
| | |-- bin
| | `-- lib
| `-- (others)
`-- .build
|-- Executable
| |-- Debug
| `-- Release
`-- DLL
|-- Debug
`-- Release
我希望我只需要点击build solution
,我的DLL
中的库文件就会自动复制到SolutionDir/.libs/DLL/*
(*=include
&&lib
&&bin
)。并且(DLL).dll
文件也应该被复制到SolutionDir/.build/Executable/(Configuration)
。
我想我可以创建一个batch
文件来复制这些文件,但如何在每次构建DLL
时运行它
或者MSVC是否有一些内置功能可以实现这一点?
使用"后生成事件";在命令行中,添加copy /Y "$(TargetPath)" "$SolutionDir/.libs/DLL/lib"
和其他。
相关文章:
- 我有两个类需要在同一 cpp 文件中相互引用,但第一个类无法识别第二个类类型的对象
- 等待整个 omp 块完成,然后再调用第二个函数
- 我想在C++中读取一些多个字符,但它永远不会读取第二个字符
- 如何在创建自定义迭代器时获得 std::p air 的第一个和第二个?
- WinAPI 在单击第一个对话框上的按钮控件并销毁第一个对话框后创建第二个对话框
- 将第二个 GATT 服务添加到 Movesense 容器
- 如何在 c++ 中根据第二个元素按降序对列表进行排序
- 对的排序向量 (std::vector<pair<int, int>>) 按对的第一个元素搜索并更新第二个元素值
- 比较 2 个向量并从第二个向量中删除在第一个 - c++ 中找不到的元素
- 为什么这个程序没有打印返回的迭代器的正确第二个元素?
- 使第二个类的构造函数成为第一个类中的友元函数
- 为什么第二个代码给出了预期的结果,而第一个代码却没有?
- 为什么第一个代码块产生垃圾值,而第二个代码块将类成员的值相加?
- 打印无序映射的第二个元素,即集合
- 我有一个类,它创建了另一个类的实例.如何将变量通过第一个类传递到第二个类的实例化中?
- 需要使用模板查找数组的第二个最小和最小值
- 在 Android 的第二个项目中添加一个 .so 库
- 仅在添加第二个项目后编译一个项目的错误
- 如何将一个项目的构建文件复制到第二个项目的include/library目录
- 在Visual Studio 2010中创建第二个C++项目