| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <TargetFramework>net48</TargetFramework>
- <Nullable>disable</Nullable>
- <UseWPF>true</UseWPF>
- <Platforms>x64</Platforms>
- <PlatformTarget>x64</PlatformTarget>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
- <RootNamespace>Plugins.Halcon</RootNamespace>
- <AssemblyName>Plugins.Halcon</AssemblyName>
- </PropertyGroup>
- <!-- HALCON 环境:把 HALCON 的托管 DLL(halcondotnet.dll 等)放进工程内 HalconSdk\ 目录即被自动引用(无需逐个登记),
- 与 Plugins.Vm 的 VmSdk\ 思路一致——“丢进目录就自动引”。目录为空时不产生任何引用。
- 运行期还需 HALCON 原生运行库(halcon.dll 等)+ 授权,通常由安装 HALCON 或把原生 DLL 放到 EXE 目录提供。 -->
- <PropertyGroup>
- <HalconSdkRoot>$(MSBuildThisFileDirectory)HalconSdk</HalconSdkRoot>
- </PropertyGroup>
- <ItemGroup>
- <HalconSdkDll Include="$(HalconSdkRoot)\**\*.dll" />
- </ItemGroup>
- <ItemGroup>
- <PackageReference Include="OpenCvSharp4" Version="4.13.0.20260627" />
- <PackageReference Include="OpenCvSharp4.runtime.win" Version="4.13.0.20260627" />
- <PackageReference Include="PropertyGridLib" Version="1.2.0" />
- <PackageReference Include="System.Text.Json" Version="10.0.0" />
- </ItemGroup>
- <ItemGroup>
- <Reference Include="@(HalconSdkDll->'%(FileName)')">
- <HintPath>%(HalconSdkDll.Identity)</HintPath>
- <Private>True</Private>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\TeamAAS.Core\TeamAAS.Core\TeamAAS.Core.csproj" />
- </ItemGroup>
- <ItemGroup>
- <Reference Include="Microsoft.DwayneNeed">
- <HintPath>..\..\lib\Microsoft.DwayneNeed.dll</HintPath>
- <Private>True</Private>
- </Reference>
- <Reference Include="Microsoft.DwayneNeed.Win32">
- <HintPath>..\..\lib\Microsoft.DwayneNeed.Win32.dll</HintPath>
- <Private>True</Private>
- </Reference>
- <Reference Include="System.Windows.Forms" />
- <Reference Include="WindowsFormsIntegration" />
- <Reference Include="System.Drawing" />
- </ItemGroup>
- <!-- 生成后:把插件 DLL 复制到 EXE\win-x64\Plugins\HalconPlugins\(视觉平台子目录,PluginLoader 递归扫描);
- 同时把 HalconSdk\ 里的托管 DLL 一并复制过去,使 Assembly.LoadFrom 能在同目录探测到 halcondotnet.dll。 -->
- <Target Name="CopyPluginDll" AfterTargets="Build" Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
- <PropertyGroup>
- <PluginDir>$(MSBuildThisFileDirectory)..\..\EXE\win-x64\Plugins\HalconPlugins\</PluginDir>
- </PropertyGroup>
- <MakeDir Directories="$(PluginDir)" Condition="!Exists('$(PluginDir)')" />
- <Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PluginDir)" SkipUnchangedFiles="true" />
- <Copy SourceFiles="@(HalconSdkDll)" DestinationFolder="$(PluginDir)" SkipUnchangedFiles="true" Condition="'@(HalconSdkDll)'!=''" />
- </Target>
- </Project>
|