<?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>
  <groupId>org.bytedeco</groupId>
  <artifactId>javacpp-presets</artifactId>
  <version>0.11</version>
  <packaging>pom</packaging>

  <name>JavaCPP Presets</name>
  <description>The missing bridge between Java and native C++ libraries</description>
  <url>http://bytedeco.org/javacpp-presets/</url>

  <licenses>
    <license>
      <name>GPLv2 with Classpath exception</name>
      <url>http://www.gnu.org/software/classpath/license.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Samuel Audet</name>
      <email>samuel.audet@gmail.com</email>
    </developer>
  </developers>

  <modules>
    <module>opencv</module>
    <module>ffmpeg</module>
    <module>flycapture</module>
    <module>libdc1394</module>
    <module>libfreenect</module>
    <module>videoinput</module>
    <module>artoolkitplus</module>
    <module>flandmark</module>
    <module>fftw</module>
    <module>gsl</module>
    <module>llvm</module>
    <module>leptonica</module>
    <module>tesseract</module>
    <module>caffe</module>
  </modules>

  <scm>
    <url>https://github.com/bytedeco/javacpp-presets</url>
    <connection>scm:git:git://github.com/bytedeco/javacpp-presets.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/bytedeco/javacpp-presets.git</developerConnection>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Sonatype Nexus Staging</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <generate-sources.skip>false</generate-sources.skip> <!-- To skip header file parsing phase: -Dgenerate-sources.skip=true  -->
    <process-classes.skip> false</process-classes.skip>  <!-- To skip native compilation phase: -Dprocess-classes.skip=true    -->
    <platform>${os.name}-${os.arch}</platform> <!-- For Android: -Dplatform=android-arm                                        -->
    <platform.root></platform.root>            <!--              -Dplatform.root=/path/to/android-ndk/                         -->
    <platform.compiler></platform.compiler>    <!--              -Dplatform.compiler=/path/to/arm-linux-androideabi-g++        -->
    <platform.properties>${platform}</platform.properties>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.bytedeco</groupId>
        <artifactId>javacpp</artifactId>
        <version>${project.parent.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <finalName>${project.artifactId}</finalName>
    <pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>resources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <skipMain>${generate-sources.skip}</skipMain>
              <includes>
                <include>org/bytedeco/javacpp/presets/*.java</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.bytedeco</groupId>
        <artifactId>javacpp</artifactId>
        <version>${project.parent.version}</version>
        <configuration>
          <properties>${platform.properties}</properties>
          <propertyKeysAndValues>
            <property>
              <name>platform.root</name>
              <value>${platform.root}</value>
            </property>
            <property>
              <name>platform.compiler</name>
              <value>${platform.compiler}</value>
            </property>
          </propertyKeysAndValues>
          <classPath>${project.build.outputDirectory}</classPath>
          <includePath>${basedir}/cppbuild/${platform}/include/</includePath>
          <linkPath>${basedir}/cppbuild/${platform}/lib/</linkPath>
          <preloadPath>${basedir}/cppbuild/${platform}/bin/</preloadPath>
        </configuration>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>build</goal>
            </goals>
            <configuration>
              <skip>${generate-sources.skip}</skip>
              <outputDirectory>${project.build.sourceDirectory}</outputDirectory>
              <classOrPackageName>org.bytedeco.javacpp.presets.*</classOrPackageName>
            </configuration>
          </execution>
          <execution>
            <id>process-classes</id>
            <phase>process-classes</phase>
            <goals>
              <goal>build</goal>
            </goals>
            <configuration>
              <skip>${process-classes.skip}</skip>
              <classOrPackageName>org.bytedeco.javacpp.*</classOrPackageName>
              <copyLibs>true</copyLibs>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>default-jar</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <archive>
                <manifest>
                  <addClasspath>true</addClasspath>
                </manifest>
                <manifestEntries>
                  <!-- <addClasspath/> is broken: http://jira.codehaus.org/browse/MJAR-61 -->
                  <Class-Path>./ javacpp.jar ${project.artifactId}-linux-arm.jar ${project.artifactId}-linux-x86.jar ${project.artifactId}-linux-x86_64.jar ${project.artifactId}-macosx-x86.jar ${project.artifactId}-macosx-x86_64.jar ${project.artifactId}-windows-x86.jar ${project.artifactId}-windows-x86_64.jar</Class-Path>
                  <Name>org/bytedeco/javacpp/presets/</Name>
                  <Implementation-Title>${project.name}</Implementation-Title>
                  <Implementation-Vendor>Bytedeco</Implementation-Vendor>
                  <Implementation-Version>${project.version}</Implementation-Version>
                  <Specification-Title>${project.name}</Specification-Title>
                  <Specification-Vendor>Bytedeco</Specification-Vendor>
                  <Specification-Version>${project.version}</Specification-Version>
                </manifestEntries>
              </archive>
              <includes>
                <include>org/bytedeco/javacpp/*</include>
                <include>org/bytedeco/javacpp/helper/*</include>
                <include>org/bytedeco/javacpp/presets/*</include>
              </includes>
              <excludes>
                <exclude>org/bytedeco/javacpp/*.h</exclude>
                <exclude>org/bytedeco/javacpp/linux-*/</exclude>
                <exclude>org/bytedeco/javacpp/macosx-*/</exclude>
                <exclude>org/bytedeco/javacpp/windows-*/</exclude>
                <exclude>org/bytedeco/javacpp/${platform}/</exclude>
              </excludes>
            </configuration>
          </execution>
          <execution>
            <id>${platform}</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>${platform}</classifier>
              <skipIfEmpty>true</skipIfEmpty>
              <includes>
                <include>${platform.library.path}/</include>
                <include>org/bytedeco/javacpp/${platform}/</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.3</version>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.parent.build.directory}</outputDirectory>
              <stripVersion>true</stripVersion>
            </configuration>
          </execution>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <stripVersion>true</stripVersion>
              <artifactItems>
                <artifactItem>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>${project.artifactId}</artifactId>
                  <version>${project.version}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.parent.build.directory}</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>${project.artifactId}</artifactId>
                  <version>${project.version}</version>
                  <classifier>${platform}</classifier>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.parent.build.directory}</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <createChecksum>true</createChecksum>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.2</version>
        <executions>
          <execution>
            <id>attach-source</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <detectLinks>true</detectLinks>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6</version>
        <executions>
          <execution>
            <id>default-deploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
        <extensions>true</extensions>
        <configuration>
          <serverId>sonatype-nexus-staging</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <skipStagingRepositoryClose>true</skipStagingRepositoryClose>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>doclint-java8-disable</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <additionalparam>-Xdoclint:none</additionalparam>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>assembly</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.3</version>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/bin.xml</descriptor>
                <descriptor>src/main/assembly/src.xml</descriptor>
              </descriptors>
            </configuration>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Provide convenient profiles to set commonly used paths for Android -->
    <profile>
      <id>android-arm</id>
      <activation>
        <property>
          <name>platform</name>
          <value>android-arm</value>
        </property>
      </activation>
      <properties>
        <platform>android-arm</platform>
        <platform.root>${user.home}/Android/android-ndk/</platform.root>
        <platform.compiler>toolchains/arm-linux-androideabi-4.6/prebuilt/${os.name}-${os.arch}/bin/arm-linux-androideabi-g++</platform.compiler>
      </properties>
    </profile>
    <profile>
      <id>android-x86</id>
      <activation>
        <property>
          <name>platform</name>
          <value>android-x86</value>
        </property>
      </activation>
      <properties>
        <platform>android-x86</platform>
        <platform.root>${user.home}/Android/android-ndk/</platform.root>
        <platform.compiler>toolchains/x86-4.6/prebuilt/${os.name}-${os.arch}/bin/i686-linux-android-g++</platform.compiler>
      </properties>
    </profile>

    <!-- Include platform dependency by default for modules without a C++ build script file -->
    <profile>
      <id>platform-dependency-default</id>
      <activation>
        <file>
          <missing>${user.dir}/cppbuild.sh</missing>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>${project.artifactId}</artifactId>
          <version>${project.version}</version>
          <classifier>${platform}</classifier>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>platform-dependency</id>
      <activation>
        <property>
          <name>platform.dependency</name>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>${project.artifactId}</artifactId>
          <version>${project.version}</version>
          <classifier>${platform}</classifier>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>platform-dependencies</id>
      <activation>
        <property>
          <name>platform.dependencies</name>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>${project.artifactId}</artifactId>
          <version>${project.version}</version>
          <classifier>${platform}</classifier>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>${project.artifactId}</artifactId>
          <version>${project.version}</version>
          <classifier>android-arm</classifier>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>${project.artifactId}</artifactId>
          <version>${project.version}</version>
          <classifier>android-x86</classifier>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>${project.artifactId}</artifactId>
          <version>${project.version}</version>
          <classifier>linux-x86</classifier>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>${project.artifactId}</artifactId>
          <version>${project.version}</version>
          <classifier>linux-x86_64</classifier>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>${project.artifactId}</artifactId>
          <version>${project.version}</version>
          <classifier>macosx-x86_64</classifier>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>${project.artifactId}</artifactId>
          <version>${project.version}</version>
          <classifier>windows-x86</classifier>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>${project.artifactId}</artifactId>
          <version>${project.version}</version>
          <classifier>windows-x86_64</classifier>
        </dependency>
      </dependencies>
    </profile>

    <!-- If someone knows a better way to do this, please do let me know! -->
    <profile>
      <id>linux</id>
      <activation>
        <os><name>linux</name></os>
      </activation>
      <properties>
        <os.name>linux</os.name>
      </properties>
    </profile>
    <profile>
      <id>macosx</id>
      <activation>
        <os><name>mac os x</name></os>
      </activation>
      <properties>
        <os.name>macosx</os.name>
      </properties>
    </profile>
    <profile>
      <id>windows</id>
      <activation>
        <os><family>windows</family></os>
      </activation>
      <properties>
        <os.name>windows</os.name>
      </properties>
    </profile>
    <profile>
      <id>i386</id>
      <activation>
        <os><arch>i386</arch></os>
      </activation>
      <properties>
        <os.arch>x86</os.arch>
      </properties>
    </profile>
    <profile>
      <id>i486</id>
      <activation>
        <os><arch>i486</arch></os>
      </activation>
      <properties>
        <os.arch>x86</os.arch>
      </properties>
    </profile>
    <profile>
      <id>i586</id>
      <activation>
        <os><arch>i586</arch></os>
      </activation>
      <properties>
        <os.arch>x86</os.arch>
      </properties>
    </profile>
    <profile>
      <id>i686</id>
      <activation>
        <os><arch>i686</arch></os>
      </activation>
      <properties>
        <os.arch>x86</os.arch>
      </properties>
    </profile>
    <profile>
      <id>amd64</id>
      <activation>
        <os><arch>amd64</arch></os>
      </activation>
      <properties>
        <os.arch>x86_64</os.arch>
      </properties>
    </profile>
    <profile>
      <id>x86-64</id>
      <activation>
        <os><arch>x86-64</arch></os>
      </activation>
      <properties>
        <os.arch>x86_64</os.arch>
      </properties>
    </profile>
  </profiles>

</project>
