| <?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.iotdb</groupId> |
| <artifactId>client-cpp-tools</artifactId> |
| <version>0.14.0-SNAPSHOT</version> |
| <relativePath>../pom.xml</relativePath> |
| </parent> |
| <artifactId>client-cpp-tools-thrift</artifactId> |
| <packaging>jar</packaging> |
| <name>Tools: Thrift</name> |
| <description>Local build of the Apache Thrift compiler.</description> |
| <properties> |
| <thrift.with.cpp>ON</thrift.with.cpp> |
| <thrift.with.csharp>ON</thrift.with.csharp> |
| <thrift.with.python>ON</thrift.with.python> |
| </properties> |
| <profiles> |
| <profile> |
| <id>compile-cpp</id> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>com.googlecode.maven-download-plugin</groupId> |
| <artifactId>download-maven-plugin</artifactId> |
| <version>1.6.7</version> |
| <executions> |
| <!-- Download the CMake binary distribution for this platform. --> |
| <execution> |
| <id>get-cmake</id> |
| <phase>generate-sources</phase> |
| <goals> |
| <goal>wget</goal> |
| </goals> |
| <configuration> |
| <url>${cmake.url}</url> |
| <unpack>true</unpack> |
| <outputDirectory>${project.build.directory}</outputDirectory> |
| </configuration> |
| </execution> |
| <!-- Download the sources for building the thrift compiler --> |
| <execution> |
| <id>get-thrift</id> |
| <phase>generate-sources</phase> |
| <goals> |
| <goal>wget</goal> |
| </goals> |
| <configuration> |
| <url>https://archive.apache.org/dist/thrift/${thrift.version}/thrift-${thrift.version}.tar.gz</url> |
| <unpack>true</unpack> |
| <outputDirectory>${project.build.directory}</outputDirectory> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <groupId>com.googlecode.cmake-maven-project</groupId> |
| <artifactId>cmake-maven-plugin</artifactId> |
| <version>3.7.2-b1</version> |
| <executions> |
| <!-- Uses a CMake generator to generate the build using the build tool of choice --> |
| <execution> |
| <id>cmake-generate</id> |
| <phase>generate-sources</phase> |
| <goals> |
| <goal>generate</goal> |
| </goals> |
| <configuration> |
| <classifier>${os.classifier}</classifier> |
| <!-- |
| We need to use a newer version of cmake, so disable downloading |
| and tell the plugin where to find that version. |
| --> |
| <downloadBinaries>false</downloadBinaries> |
| <sourcePath>${project.build.directory}/thrift-${thrift.version}</sourcePath> |
| <targetPath>${project.build.directory}/build</targetPath> |
| <generator>${cmake.generator}</generator> |
| <options> |
| <!-- Disable testing for now --> |
| <option>-DBUILD_TESTING=OFF</option> |
| <!-- Enable and disable the building of code generators for different languages --> |
| <option>-DTHRIFT_COMPILER_AS3=OFF</option> |
| <option>-DTHRIFT_COMPILER_C_GLIB=OFF</option> |
| <option>-DTHRIFT_COMPILER_CL=OFF</option> |
| <option>-DTHRIFT_COMPILER_CPP=${thrift.with.cpp}</option> |
| <option>-DTHRIFT_COMPILER_CSHARP=${thrift.with.csharp}</option> |
| <option>-DTHRIFT_COMPILER_D=OFF</option> |
| <option>-DTHRIFT_COMPILER_DART=OFF</option> |
| <option>-DTHRIFT_COMPILER_DELPHI=OFF</option> |
| <option>-DTHRIFT_COMPILER_ERL=OFF</option> |
| <option>-DTHRIFT_COMPILER_GO=ON</option> |
| <option>-DTHRIFT_COMPILER_GV=OFF</option> |
| <option>-DTHRIFT_COMPILER_HAXE=OFF</option> |
| <option>-DTHRIFT_COMPILER_HS=OFF</option> |
| <option>-DTHRIFT_COMPILER_HTML=OFF</option> |
| <option>-DTHRIFT_COMPILER_JAVA=ON</option> |
| <option>-DTHRIFT_COMPILER_JAVAME=ON</option> |
| <option>-DTHRIFT_COMPILER_JAVASCRIPT=OFF</option> |
| <option>-DTHRIFT_COMPILER_JSON=OFF</option> |
| <option>-DTHRIFT_COMPILER_LUA=OFF</option> |
| <option>-DTHRIFT_COMPILER_NETCORE=ON</option> |
| <option>-DTHRIFT_COMPILER_NETSTD=ON</option> |
| <option>-DTHRIFT_COMPILER_NODEJS=OFF</option> |
| <option>-DTHRIFT_COMPILER_OCAML=OFF</option> |
| <option>-DTHRIFT_COMPILER_PERL=OFF</option> |
| <option>-DTHRIFT_COMPILER_PHP=OFF</option> |
| <option>-DTHRIFT_COMPILER_PY=${thrift.with.python}</option> |
| <option>-DTHRIFT_COMPILER_RB=OFF</option> |
| <option>-DTHRIFT_COMPILER_RS=OFF</option> |
| <option>-DTHRIFT_COMPILER_ST=OFF</option> |
| <option>-DTHRIFT_COMPILER_SWIFT=OFF</option> |
| <option>-DTHRIFT_COMPILER_XML=OFF</option> |
| <option>-DTHRIFT_COMPILER_XSD=OFF</option> |
| <!-- Enable and disable the building of libs for different languages --> |
| <option>-DBUILD_C_GLIB=OFF</option> |
| <option>-DBUILD_CPP=${thrift.with.cpp}</option> |
| <!-- Unfortunately this doesn't exist yet --> |
| <option>-DBUILD_CSHARP=${thrift.with.csharp}</option> |
| <!-- Don't build Java, as the libs are available via Maven --> |
| <option>-DBUILD_JAVA=OFF</option> |
| <option>-DBUILD_NODEJS=OFF</option> |
| <option>-DBUILD_PYTHON=${thrift.with.python}</option> |
| <option>-DBUILD_JAVASCRIPT=OFF</option> |
| <option>-DBUILD_HASKELL=OFF</option> |
| <option>-DWITH_SHARED_LIB=OFF</option> |
| <!-- Generate libthrift.a to compile IoTDB Session --> |
| <option>-DWITH_STATIC_LIB=ON</option> |
| <option>-DCMAKE_POSITION_INDEPENDENT_CODE=ON</option> |
| <!-- Specify openssl include path for Mac OS --> |
| <option>${openssl.include.dir}</option> |
| <!-- Specify new version Bison path for Mac OS --> |
| <option>${bison.executable.dir}</option> |
| <option>-DBOOST_INCLUDEDIR=${boost.include.dir}</option> |
| <option>-DBOOST_LIBRARYDIR=${boost.library.dir}</option> |
| </options> |
| </configuration> |
| </execution> |
| <!-- Actually executes the build --> |
| <execution> |
| <id>cmake-compile</id> |
| <phase>compile</phase> |
| <goals> |
| <goal>compile</goal> |
| </goals> |
| <configuration> |
| <classifier>${os.classifier}</classifier> |
| <config>${cmake.build.type}</config> |
| <!-- |
| We need to use a newer version of cmake, so disable downloading |
| and tell the plugin where to find that version. |
| --> |
| <downloadBinaries>false</downloadBinaries> |
| <!-- The directory where the "generate" step generated the build configuration --> |
| <projectDirectory>${project.build.directory}/build</projectDirectory> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <!-- Copy the config.h file into thrift include directory --> |
| <plugin> |
| <groupId>com.coderplus.maven.plugins</groupId> |
| <artifactId>copy-rename-maven-plugin</artifactId> |
| <version>1.0.1</version> |
| <executions> |
| <execution> |
| <id>copy-thrift-config</id> |
| <goals> |
| <goal>copy</goal> |
| </goals> |
| <phase>generate-resources</phase> |
| <configuration> |
| <fileSets> |
| <fileSet> |
| <sourceFile>${project.build.directory}/build/thrift/config.h</sourceFile> |
| <destinationFile>${project.build.directory}/thrift-${thrift.version}/lib/cpp/src/thrift/config.h</destinationFile> |
| </fileSet> |
| </fileSets> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| </profiles> |
| </project> |