<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.bytedeco</groupId>
    <artifactId>javacpp-presets</artifactId>
    <version>1.5.7</version>
  </parent>

  <groupId>org.bytedeco</groupId>
  <artifactId>openblas</artifactId>
  <version>0.3.19-${project.parent.version}</version>
  <name>JavaCPP Presets for OpenBLAS</name>

  <properties>
    <javacpp.compiler.option>-O3</javacpp.compiler.option>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.bytedeco</groupId>
      <artifactId>javacpp</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>javacpp-parser-package</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.bytedeco</groupId>
        <artifactId>javacpp</artifactId>
        <!-- Execute parser again to get full LAPACK bindings even with Android and iOS -->
        <executions>
          <execution>
            <id>javacpp-parser-package</id>
            <phase>process-classes</phase>
            <goals>
              <goal>build</goal>
            </goals>
            <configuration>
              <properties>${os.name}-${os.arch}</properties>
              <skip>${javacpp.parser.skip}</skip>
              <outputDirectory>${project.basedir}/src/gen/java</outputDirectory>
              <classOrPackageName>org.bytedeco.openblas.presets.*</classOrPackageName>
            </configuration>
          </execution>
          <execution>
            <id>javacpp-validate-package</id>
            <phase>process-classes</phase>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
          <execution>
            <id>javacpp-postbuild</id>
            <phase>process-classes</phase>
            <goals>
              <goal>build</goal>
            </goals>
            <configuration>
              <skip>${javacpp.compiler.skip}</skip>
              <buildCommand>
                <program>bash</program>
                <argument>${project.basedir}/postbuild.sh</argument>
              </buildCommand>
              <workingDirectory>${project.basedir}</workingDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>javacpp-${javacpp.platform}</id>
            <phase>package</phase>
            <configuration>
              <excludes>
                <exclude>org/bytedeco/openblas/${javacpp.platform}/*mkl*</exclude>
                <exclude>org/bytedeco/openblas/${javacpp.platform}/*omp*</exclude>
                <exclude>org/bytedeco/openblas/${javacpp.platform}/*libopenblas_nolapack*</exclude>
                <exclude>org/bytedeco/openblas/${javacpp.platform}/bin/*openblas*</exclude>
                <exclude>org/bytedeco/openblas/${javacpp.platform}/lib/*libopenblas*</exclude>
                <exclude>${javacpp.platform.library.path}/*libopenblas_nolapack*</exclude>
                <exclude>${javacpp.platform.library.path}/lib/*openblas*</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.moditect</groupId>
        <artifactId>moditect-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>msvc</id>
      <activation>
        <os><family>windows</family></os>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.bytedeco</groupId>
            <artifactId>javacpp</artifactId>
            <configuration>
              <properties>${javacpp.platform}</properties>
              <compilerOptions>
                <compilerOption>/MT</compilerOption>
              </compilerOptions>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
