Visual Studio 2105里面的工程属性扩展

1.生成一个自定义的属性页文件

CommonSettings.props

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets" />
  <PropertyGroup Label="UserMacros">
    <BuildDir>$(SolutionDir)Build</BuildDir>
    <IERoot>C:\Intel\computer_vision_sdk_2018.5.456\deployment_tools\inference_engine</IERoot>	
	<OpenCVRoot>E:\AI\opencv-4.0.1</OpenCVRoot> 
    <CuDnnPath>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2</CuDnnPath> 
  </PropertyGroup>
  <PropertyGroup > 
    <LibraryPath>$(IERoot)\lib\intel64\$(Configuration);$(OpenCVRoot)\build\$(Platform)\vc14\lib;$(LibraryPath)</LibraryPath>
    <IncludePath>$(IERoot)\samples\thirdparty;$(IERoot)\include;$(OpenCVRoot)\build\include;$(IncludePath)</IncludePath>
  </PropertyGroup>
    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <Optimization>Full</Optimization>
      <PreprocessorDefinitions>NDEBUG;WIN32;_WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <DisableSpecificWarnings>4819;</DisableSpecificWarnings>
    </ClCompile>
    <Link>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <GenerateDebugInformation>false</GenerateDebugInformation>
      <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
      <OptimizeReferences>true</OptimizeReferences>
      <AdditionalDependencies>inference_engine.lib;libiomp5md.lib;opencv_world401.lib;$(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>_DEBUG;WIN32;_WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
      <DisableSpecificWarnings>4819;</DisableSpecificWarnings>
    </ClCompile>
    <Link>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <AdditionalDependencies>inference_engined.lib;libiomp5md.lib;opencv_world401d.lib;$(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
</Project>

2. 在.sln文件里增加属性页文件

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "props", "props", "{632DD6E1-28DF-42F9-AD7F-1C1F2D38765C}"
	ProjectSection(SolutionItems) = preProject
		CommonSettings.props = CommonSettings.props
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiny_yolov3_image_detect", "tiny_yolov3_image_detect.vcxproj", "{F82D5D8C-7C26-4D2B-8690-7BC8C26E3030}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|x64 = Debug|x64
		Release|x64 = Release|x64
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{F82D5D8C-7C26-4D2B-8690-7BC8C26E3030}.Debug|x64.ActiveCfg = Debug|x64
		{F82D5D8C-7C26-4D2B-8690-7BC8C26E3030}.Debug|x64.Build.0 = Debug|x64
		{F82D5D8C-7C26-4D2B-8690-7BC8C26E3030}.Release|x64.ActiveCfg = Release|x64
		{F82D5D8C-7C26-4D2B-8690-7BC8C26E3030}.Release|x64.Build.0 = Release|x64
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal

3. 在.vcxproj里面增加

<ImportGroup Label="PropertySheets" Condition="Exists('$(SolutionDir)CommonSettings.props')">
    <Import Project="$(SolutionDir)CommonSettings.props" />
  </ImportGroup>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值