<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>ai.kognition.pilecv4j</groupId>
    <artifactId>opencv-packaging</artifactId>
    <version>1.0-opencv4.5.2</version>
  </parent>
  <artifactId>opencv-${platform}</artifactId>
  <description>Package all opencv with lib</description>

  <properties>
    <opencv-libs-path>src/temp/libs</opencv-libs-path>
    <maven.deploy.skip>false</maven.deploy.skip>
  </properties>

  <dependencies>
    <dependency>
      <groupId>ai.kognition.pilecv4j</groupId>
      <artifactId>opencv</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>ai.kognition.pilecv4j</groupId>
      <artifactId>opencv-install-jar</artifactId>
      <optional>true</optional>
      <type>pom</type>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>src/main/cpp</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <descriptors>
            <descriptor>assemblies/withlib.xml</descriptor>
          </descriptors>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.3</version>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <configuration>
              <tasks>
                <checksum todir="${opencv-libs-path}" format="CHECKSUM">
                  <fileset dir="${opencv-libs-path}">
                    <include name="**/*.dll"/>
                    <include name="**/*.pdb"/>
                    <include name="**/*.so"/>
                    <include name="**/*.dylib"/>
                  </fileset>
                </checksum>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
