Saturday, November 1, 2014

OpenCV Property Sheets - Visual Studio

OpenCV Property Sheets

For: Visual Studio 

I created 2 property sheets one for Debug and one for Release, see attached.

To use these you will need to open them with a text editor (they are just ASCII XML files) and change the pathing so that it matches your pathing to opencv. I used version 243, so make sure you update that number as needed.

Once the property sheets are pointing to the correct locations, then move the files to a common area so you can reference them for all projects/solutions you create.

In the Property Manager right-click on debug and select Add Property Sheet and select OpenCV243PropD.props, then on the Release right-click and select Add Property Sheet and select OpenCV243Prop.props.

 -- attachment 1 / 2 : filename OpenCV243Prop.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" />
  <PropertyGroup />
  <ItemDefinitionGroup>
    <ClCompile>
      <AdditionalIncludeDirectories>"C:\opencv\build\include"</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <AdditionalLibraryDirectories>"C:\opencv\build\x86\vc10\lib"</AdditionalLibraryDirectories>
      <AdditionalDependencies>opencv_core243.lib;opencv_imgproc243.lib;opencv_highgui243.lib;opencv_ml243.lib;opencv_video243.lib;opencv_features2d243.lib;opencv_calib3d243.lib;opencv_objdetect243.lib;opencv_contrib243.lib;opencv_legacy243.lib;opencv_flann243.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemGroup />
</Project>

 -- attachment 2 / 2 : filename OpenCV243Prop.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" />
  <PropertyGroup />
  <ItemDefinitionGroup>
    <ClCompile>
      <AdditionalIncludeDirectories>"C:\opencv\build\include"</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <AdditionalLibraryDirectories>"C:\opencv\build\x86\vc10\lib"</AdditionalLibraryDirectories>
      <AdditionalDependencies>opencv_core243d.lib;opencv_imgproc243d.lib;opencv_highgui243d.lib;opencv_ml243d.lib;opencv_video243d.lib;opencv_features2d243d.lib;opencv_calib3d243d.lib;opencv_objdetect243d.lib;opencv_contrib243d.lib;opencv_legacy243d.lib;opencv_flann243d.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemGroup />
</Project>