From 1f826baefd9d9608de20143a81363ca020cf2951 Mon Sep 17 00:00:00 2001
From: Jeongseok Lee <jslee02@gmail.com>
Date: Fri, 6 Mar 2015 02:55:52 -0500
Subject: [PATCH] Support Travis-CI

---
 .travis.yml         | 41 +++++++++++++++++++++++++++++++++++++++++
 README.md           |  3 +--
 ci/install_linux.sh | 24 ++++++++++++++++++++++++
 ci/install_osx.sh   |  6 ++++++
 4 files changed, 72 insertions(+), 2 deletions(-)
 create mode 100644 .travis.yml
 create mode 100755 ci/install_linux.sh
 create mode 100755 ci/install_osx.sh

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..097781a4
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,41 @@
+language: cpp
+
+os:
+  - linux
+  - osx
+
+compiler:
+  - gcc
+  - clang
+
+env:
+  - BUILD_TYPE=Debug
+  - BUILD_TYPE=Release
+
+matrix:
+  exclude:
+    - os: osx
+      compiler: gcc
+
+install:
+  # Install dependencies for FCL
+  - if [ "$TRAVIS_OS_NAME" = "linux" ]; then 'ci/install_linux.sh' ; fi
+  - if [ "$TRAVIS_OS_NAME" = "osx"   ]; then 'ci/install_osx.sh'   ; fi
+
+script:
+  # Create build directory
+  - mkdir build
+  - cd build 
+
+  # Configure
+  - cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
+
+  # Build
+  - make -j4
+
+  # Run unit tests
+  - make test
+
+  # Make sure we can install with no issues
+  - sudo make -j4 install
+
diff --git a/README.md b/README.md
index 43aba71e..492826f7 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,4 @@
-## FCL -- The Flexible Collision Library
-
+## FCL -- The Flexible Collision Library [![Build Status](https://travis-ci.org/flexible-collision-library/fcl.svg)](https://travis-ci.org/flexible-collision-library/fcl)
 
 FCL is a library for performing three types of proximity queries on a pair of geometric models composed of triangles. 
  - Collision detection: detecting whether the two models overlap, and optionally, all of the triangles that overlap.
diff --git a/ci/install_linux.sh b/ci/install_linux.sh
new file mode 100755
index 00000000..85458700
--- /dev/null
+++ b/ci/install_linux.sh
@@ -0,0 +1,24 @@
+sudo add-apt-repository --yes ppa:libccd-debs/ppa
+sudo apt-get -qq update
+
+########################
+# Mendatory dependencies
+########################
+sudo apt-get -qq --yes --force-yes install cmake
+sudo apt-get -qq --yes --force-yes install libboost-all-dev
+sudo apt-get -qq --yes --force-yes install libccd-dev
+
+########################
+# Optional dependencies
+########################
+sudo apt-get -qq --yes --force-yes install libflann-dev
+
+# Octomap
+git clone https://github.com/OctoMap/octomap
+cd octomap
+git checkout tags/v1.6.8
+mkdir build
+cd build
+cmake ..
+make
+sudo make install
diff --git a/ci/install_osx.sh b/ci/install_osx.sh
new file mode 100755
index 00000000..1b1a6107
--- /dev/null
+++ b/ci/install_osx.sh
@@ -0,0 +1,6 @@
+brew tap homebrew/science
+
+brew install git
+brew install cmake
+brew install boost
+brew install libccd
-- 
GitLab