Skip to content

Instantly share code, notes, and snippets.

@hunandy14
Last active January 26, 2021 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hunandy14/c5a74e769bd29be3c6a36b139f044573 to your computer and use it in GitHub Desktop.
Save hunandy14/c5a74e769bd29be3c6a36b139f044573 to your computer and use it in GitHub Desktop.
VS2019 設置 OpneCV 設置擋
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets"></ImportGroup>
<!-- 使用說明詳見:https://charlottehong.blogspot.com/2021/01/opencv-451-visual-studio-2019.html -->
<!-- 使用者自訂變數 -->
<PropertyGroup Label="UserMacros">
<!-- 函式庫檔案,多個用分號隔開 -->
<cvLib_x64>opencv_world451.lib</cvLib_x64>
<cvLibd_x64>opencv_world451d.lib</cvLibd_x64>
<!-- OpenCV 路徑 -->
<cvDir>C:\opencv</cvDir>
<cvIncDir>$(cvDir)\build\include</cvIncDir>
<cvLibDir>$(cvDir)\build\x64\vc15\lib</cvLibDir>
<cvBibDir>$(cvDir)\build\x64\vc15\bin</cvBibDir>
<!-- $(UserRootDir) 是 V4.0 位置-->
</PropertyGroup>
<!-- Link檔案設置 -->
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Link>
<AdditionalDependencies>$(cvLibd_x64);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Link>
<AdditionalDependencies>$(cvLib_x64);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<!-- include與Lib目錄 -->
<PropertyGroup>
<IncludePath>$(cvIncDir);$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
<LibraryPath>$(cvLibDir);$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
</PropertyGroup>
<!-- 環境變數 -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerEnvironment>PATH=%PATH%;$(cvBibDir);</LocalDebuggerEnvironment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerEnvironment>PATH=%PATH%;$(cvBibDir);</LocalDebuggerEnvironment>
</PropertyGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment