<?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>com.googlecode.jperipheral</groupId>
		<artifactId>jperipheral</artifactId>
		<version>1.0.6</version>
	</parent>
	<artifactId>jperipheral-cpp</artifactId>
	<name>JPeripheral C++</name>
	<description>JPeripheral, C++ source-code</description>
	<url>http://code.google.com/p/jperipheral/</url>
	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<scm>
		<url>https://jperipheral.googlecode.com/hg/</url>
		<connection>scm:hg:https://jperipheral.googlecode.com/hg/</connection>
		<developerConnection>scm:hg:https://jperipheral.googlecode.com/hg/</developerConnection>
	</scm>
	<developers>
		<developer>
			<id>cowwoc</id>
			<name>Gili Tzabari</name>
		</developer>
	</developers>
	<build>
		<outputDirectory>${project.build.directory}/${jperipheral.classifier}/classes</outputDirectory>
		<plugins>
			<plugin>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.3</version>
				<executions>
					<execution>
						<!-- used by peer generation and compilation process -->
						<id>unpack-dependencies</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>unpack-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/${jperipheral.classifier}/dependency</outputDirectory>
							<markersDirectory>${project.build.directory}/${jperipheral.classifier}/dependency-maven-plugin-markers</markersDirectory>
						</configuration>
					</execution>
					<execution>
						<id>copy-dependencies</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/${jperipheral.classifier}/cmake</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.googlecode.cmake-maven-project</groupId>
				<artifactId>cmake-maven-plugin</artifactId>
				<version>0.3</version>
				<executions>
					<execution>
						<id>cmake</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>generate</goal>
							<goal>compile</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<sourcePath>${basedir}/../cpp</sourcePath>
					<targetPath>${project.build.directory}/${jperipheral.classifier}/cmake</targetPath>
					<generator>${cmake.generator}</generator>
					<projectPath>${project.build.directory}/${jperipheral.classifier}/cmake/jperipheral.sln</projectPath>
					<buildType>${build.type}</buildType>
					<environmentVariables>
						<BOOST_HOME>${project.build.directory}/${jperipheral.classifier}/dependency</BOOST_HOME>
						<JACE_HOME>${project.build.directory}/${jperipheral.classifier}/dependency</JACE_HOME>
					</environmentVariables>					
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<classifier>${jperipheral.classifier}</classifier>
					<excludes>
						<!-- We use this for debugging, but it shouldn't be exported by libraries -->
						<exclude>logback.xml</exclude>
					</excludes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.googlecode.jace</groupId>
				<artifactId>jace-maven-plugin</artifactId>
				<version>1.2.5</version>
				<executions>
					<execution>
						<id>jace.generate.SerialChannel.peer</id>
						<goals>
							<goal>generate-cpp-peer</goal>
						</goals>
						<configuration>
							<classFile>${project.build.directory}/${jperipheral.classifier}/dependency/org/jperipheral/SerialChannel.class</classFile>
							<outputHeaders>${project.build.directory}/${jperipheral.classifier}/generated-sources/include</outputHeaders>
							<outputSources>${project.build.directory}/${jperipheral.classifier}/generated-sources/source</outputSources>
						</configuration>
					</execution>
					<execution>
						<id>jace.generate.SerialChannel.proxies</id>
						<goals>
							<goal>generate-cpp-proxies</goal>
						</goals>
						<configuration>
							<inputHeaders>
								<path>${project.build.directory}/../windows/include</path>
								<path>${project.build.directory}/${jperipheral.classifier}/generated-sources/include</path>
							</inputHeaders>
							<inputSources>
								<path>${project.build.directory}/../windows/source</path>
								<path>${project.build.directory}/${jperipheral.classifier}/generated-sources/source</path>
							</inputSources>
							<outputHeaders>${project.build.directory}/${jperipheral.classifier}/generated-sources/include</outputHeaders>
							<outputSources>${project.build.directory}/${jperipheral.classifier}/generated-sources/source</outputSources>
							<classPath>
								<entry>${env.JAVA_HOME}/jre/lib/rt.jar</entry>
								<entry>${project.build.directory}/${jperipheral.classifier}/dependency</entry>
							</classPath>
							<exportSymbols>true</exportSymbols>
							<accessibility>PRIVATE</accessibility>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-install-plugin</artifactId>
				<version>2.3.1</version>
			</plugin>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.5</version>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.outputDirectory}</outputDirectory>
							<resources>
								<resource>
									<directory>${project.build.directory}/${jperipheral.classifier}/cmake/${build.type}</directory>
									<includes>
										<include>*.lib</include>
										<include>*.dll</include>
										<include>*.pdb</include>
									</includes>
									<excludes>
										<exclude>main.pdb</exclude>
									</excludes>
									<targetPath>lib</targetPath>
								</resource>
							</resources>              
						</configuration>            
					</execution>
					<execution>
						<id>copy-sources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/sources</outputDirectory>
							<resources>
								<resource>
									<directory>${basedir}/windows</directory>
									<targetPath>windows</targetPath>
								</resource>
							</resources>              
						</configuration>            
					</execution>
					<execution>
						<id>resources</id>
						<phase>process-resources</phase>
						<goals>
							<goal>resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/${jperipheral.classifier}/cmake</outputDirectory>
						</configuration>            
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${project.build.directory}/sources</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<jperipheral.classifier>${platform}-${build.type}</jperipheral.classifier>
	</properties>
	<profiles>
		<profile>
			<id>windows-i386-vs10-debug</id>
			<properties>
				<cmake.generator>Visual Studio 10</cmake.generator>
				<platform>windows-i386-vs10</platform>
				<build.type>debug</build.type>
				<boost.classifier>windows-i386-vs10</boost.classifier>
			</properties>
		</profile>
		<profile>
			<id>windows-i386-vs10-release</id>
			<properties>
				<cmake.generator>Visual Studio 10</cmake.generator>
				<platform>windows-i386-vs10</platform>
				<build.type>release</build.type>
				<boost.classifier>windows-i386-vs10</boost.classifier>
			</properties>
		</profile>
		<profile>
			<id>windows-amd64-vs10-debug</id>
			<properties>
				<cmake.generator>Visual Studio 10 Win64</cmake.generator>
				<platform>windows-amd64-vs10</platform>
				<build.type>debug</build.type>
				<boost.classifier>windows-amd64-vs10</boost.classifier>
			</properties>
		</profile>
		<profile>
			<id>windows-amd64-vs10-release</id>
			<properties>
				<cmake.generator>Visual Studio 10 Win64</cmake.generator>
				<platform>windows-amd64-vs10</platform>
				<build.type>release</build.type>
				<boost.classifier>windows-amd64-vs10</boost.classifier>
			</properties>
		</profile>
	</profiles>
	<dependencies>
		<dependency>
			<groupId>com.googlecode.boost-maven-project</groupId>
			<artifactId>boost-api</artifactId>
			<version>1.47.0-b1</version>
		</dependency>
		<dependency>
			<groupId>com.googlecode.boost-maven-project</groupId>
			<artifactId>boost-filesystem</artifactId>
			<version>1.47.0-b1</version>
			<classifier>${boost.classifier}</classifier>
		</dependency>
		<dependency>
			<groupId>com.googlecode.boost-maven-project</groupId>
			<artifactId>boost-system</artifactId>
			<version>1.47.0-b1</version>
			<classifier>${boost.classifier}</classifier>
		</dependency>
		<dependency>
			<groupId>com.googlecode.jace</groupId>
			<artifactId>jace-core-cpp</artifactId>
			<version>1.2.5</version>
			<classifier>${jperipheral.classifier}</classifier>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>jperipheral-java</artifactId>
			<version>${project.version}</version>
		</dependency>
	 <dependency>
	  <groupId>ch.qos.logback</groupId>
	  <artifactId>logback-classic</artifactId>
	  <version>0.9.30</version>
	 </dependency>
	</dependencies>
</project>
