blob: f067ce9d20fe6778ad3fe928bdef3eb1ea47292d [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<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>org.apache.plc4x</groupId>
<artifactId>plc4cpp</artifactId>
<version>0.3.1</version>
</parent>
<artifactId>plc4cpp-libs</artifactId>
<packaging>pom</packaging>
<name>PLC4Cpp: Libs</name>
<description>Build of all the third party dependencies needed by the plc4cpp.</description>
<!--
Project for building platform dependent versions of the base-libs used by the plc4cpp modules.
As building these libraries usually takes quite a lot of time, they are being built in the
normal "target" directory, however the finished libs are installed in a "libs" directory.
This is done to prevent the libs from being cleaned every time.
-->
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<executions>
<execution>
<id>license-check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes combine.children="append">
<!-- Don't scan the libs directory -->
<exclude>libs/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>build-dependencies</id>
<activation>
<file>
<missing>libs/boost</missing>
</file>
</activation>
<build>
<plugins>
<!-- First download the sources for building the boost library -->
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<id>get-boost</id>
<phase>validate</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>${boost.url}</url>
<unpack>true</unpack>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!--
Then execute two build phases:
1) bootstrap the build
2) Perform the actual build and install
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>bootstrap-boost</id>
<phase>validate</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${boost.bootstrap.executable}</executable>
<arguments>
<argument>gcc</argument>
</arguments>
<workingDirectory>${project.build.directory}/libs/boost_${boost.version.underline}</workingDirectory>
</configuration>
</execution>
<execution>
<id>build-boost</id>
<phase>validate</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${boost.build.executable}</executable>
<arguments>
<!-- Have the build install the built libraries -->
<argument>install</argument>
<!-- Tell it where to install the libraries and header files -->
<argument>--prefix=${project.basedir}/libs/boost</argument>
<!-- Build only the system module (speeds up build-time drastically) -->
<argument>--with-system</argument>
<!-- On Windows machines the build failed, if this was not explicitly set -->
<argument>address-model=64</argument>
</arguments>
<workingDirectory>${project.build.directory}/libs/boost_${boost.version.underline}</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>