<?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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>dev.onvoid.webrtc</groupId>
		<artifactId>webrtc-java-parent</artifactId>
		<version>0.1.0</version>
	</parent>

	<artifactId>webrtc-java-jni</artifactId>

	<properties>
		<download.cmake>true</download.cmake>
		<webrtc.branch>branch-heads/m79</webrtc.branch>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>com.googlecode.cmake-maven-project</groupId>
				<artifactId>cmake-maven-plugin</artifactId>
				<version>3.14.5-b1</version>
				<executions>
					<execution>
						<id>cmake-generate</id>
						<phase>process-resources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
						<configuration>
							<sourcePath>.</sourcePath>
							<targetPath>${project.build.directory}/${platform}-${build.type}</targetPath>
							<classifier>${cmake.classifier}</classifier>
							<options>"${cmake.options}" "-DWEBRTC_BRANCH=${webrtc.branch}" "-DCMAKE_INSTALL_PREFIX=${project.parent.basedir}/webrtc-native/${platform}/src/main/resources/lib"</options>
							<downloadBinaries>${download.cmake}</downloadBinaries>
						</configuration>
					</execution>
					<execution>
						<id>cmake-compile</id>
						<phase>process-resources</phase>
						<goals>
							<goal>compile</goal>
						</goals>
						<configuration>
							<classifier>${cmake.classifier}</classifier>
							<config>${cmake.config}</config>
							<target>install</target>
							<projectDirectory>${project.build.directory}/${platform}-${build.type}</projectDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>windows-x86_64</id>
			<activation>
				<os>
					<family>windows</family>
					<arch>amd64</arch>
				</os>
			</activation>
			<properties>
				<platform>windows-x86_64</platform>
				<build.type>release</build.type>
				<cmake.classifier>windows-x86_64</cmake.classifier>
				<cmake.options>-Ax64</cmake.options>
				<cmake.config>Release</cmake.config>
			</properties>
		</profile>
		<profile>
			<id>linux-x86_64</id>
			<activation>
				<os>
					<family>linux</family>
					<arch>amd64</arch>
				</os>
			</activation>
			<properties>
				<platform>linux-x86_64</platform>
				<build.type>release</build.type>
				<cmake.classifier>linux-x86_64</cmake.classifier>
			</properties>
		</profile>
		<profile>
			<id>mac-x86_64</id>
			<activation>
				<os>
					<family>mac</family>
					<arch>x86_64</arch>
				</os>
			</activation>
			<properties>
				<platform>macos-x86_64</platform>
				<build.type>release</build.type>
				<cmake.classifier>mac-x86_64</cmake.classifier>
			</properties>
		</profile>
	</profiles>
</project>