I need to reference EmguCV from a solution containing one C# WinForms project.
There are four versions of the same library i.e. x86 vand x64, each with and without GPU support. The library requires references to EmguCV's managed DLLs as well as OpenCV's unmanaged DLLs. Copying the correct unmanaged version to the [Bin]
folder is easy enough through post-build events.
I want to be able to switch between the managed references easily through code. Maybe something like the following:
public enum EnumEmguCvTarget
{
None, // Do not use EmguCv
EmguCvTargetTbb86, // Target EmguCv for x86 without GPU.
EmguCvTargetGpu86, // Target EmguCv for x86 with GPU.
EmguCvTargetTbb64, // Target EmguCv for x64 without GPU.
EmguCvTargetGpu64, // Target EmguCv for x64 with GPU.
}
public EnumEmguCvTarget EmguCvTarget
{ get { return (EnumEmguCvTarget.EmguCvTargetGpu64); } }
Since I am referencing these assemblies at compile time (not late binding), is there a way I can programatically switch between versions based on the value of [EmguCvTarget]
?