zoukankan      html  css  js  c++  java
  • 在VS中生成后拷贝文件

    环境:win7_64旗舰版,VS2013

    工作项目中,一般会使用第三方库,当修改并重新编译第三方库后,需要将DLL文件拷贝到工作项目下的生成目录中,每次手动拷贝比较繁琐,VS提供自定义生成事件,允许我们在生成前、链接时、生成后执行命令。

    一、新建copy_file.bat文件

    echo copy_dll.bat
    if %Configuration%==Debug (
        echo -^> copy "%third_part%in" to "%SolutionDir%%Configuration%"
        copy /Y %third_part%in	est_d.dll %SolutionDir%%Configuration% >nul
    ) else if %Configuration%==Release (
        echo -^> copy "%third_part%in" to "%SolutionDir%%Configuration%"
        copy /Y %third_part%in	est.dll %SolutionDir%%Configuration% >nul
    ) else (
        echo Error
    )

    其中"%third_part%in"为第三方库DLL目录,"%SolutionDir%%Configuration%"当前工作项目生成目录

    二、VS项目设置

    打开 项目属性页 -> 配置属性 -> 生成事件 -> 后期生成事件

    在命令行中输入:

    set SolutionDir=$(SolutionDir)
    set Configuration=$(Configuration)
    copy_file.bat

    我们将当前工作项目中的环境变量设置到命令行中,以便在copy_file.bat中使用当前工作项目生成目录

  • 相关阅读:
    马氏距离的深入理解
    Mahalanobis Distance(马氏距离)
    Weka EM 协方差
    数据挖掘、概率分析与决策支持
    二、 Android中gravity与layout_gravity的区别
    一、 Android完全退出应用程序
    python configparse
    时间戳与时间互转
    python argparse
    时间插件
  • 原文地址:https://www.cnblogs.com/dongc/p/5205475.html
Copyright © 2011-2022 走看看