From ecb15cdd8849ffbaa0cc624f590d09836e891d66 Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Wed, 6 Jan 2016 14:51:49 +0100 Subject: [PATCH] Updated Travis script to download and cache boost source tree. --- .travis.yml | 15 ++++++--------- Applications/ApplicationsLib/CMakeLists.txt | 3 +++ scripts/cmake/ExternalProjectBoost.cmake | 5 ++++- scripts/travis/boost.sh | 11 +++++++++++ scripts/travis/cmake.sh | 2 +- 5 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 scripts/travis/boost.sh diff --git a/.travis.yml b/.travis.yml index ed3f78174f5..f946857b967 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,16 +8,10 @@ compiler: addons: apt: sources: - - boost-latest - ubuntu-toolchain-r-test # TODO: feelpp/petsc packages: - g++-4.8 - - libboost1.55-dev - - libboost-date-time1.55-dev - - libboost-filesystem1.55-dev - - libboost-program-options1.55-dev - - libboost-system1.55-dev - qt4-dev-tools - libxt-dev # TODO @@ -33,18 +27,21 @@ cache: directories: - $HOME/cmake-3.1.1-Linux-x86_64 - $HOME/VTK-Install + - $HOME/boost_1_56_0 env: global: - - VTK_DIR=VTK-Install/lib/cmake/vtk-6.3 + - VTK_DIR=$HOME/VTK-Install/lib/cmake/vtk-6.3 + - BOOST_ROOT=$HOME/boost_1_56_0 matrix: - - CASE=CLI CMAKE_ARGS="-DOGS_BUILD_GUI=OFF -DOGS_BUILD_UTILS=ON -DVTK_DIR=$HOME/$VTK_DIR" + - CASE=CLI CMAKE_ARGS="-DOGS_BUILD_GUI=OFF -DOGS_BUILD_UTILS=ON" # - CASE=CLI_PETSC CMAKE_ARGS="-DOGS_BUILD_GUI=OFF -DOGS_BUILD_UTILS=OFF -DOGS_USE_PETSC=ON -DPETSC_DIR=/usr/lib/petscdir/3.4.2/" - - CASE=GUI CMAKE_ARGS="-DOGS_BUILD_GUI=ON -DOGS_BUILD_CLI=OFF -DOGS_BUILD_TESTS=OFF -DVTK_DIR=$HOME/$VTK_DIR" + - CASE=GUI CMAKE_ARGS="-DOGS_BUILD_GUI=ON -DOGS_BUILD_CLI=OFF -DOGS_BUILD_TESTS=OFF" before_install: - bash scripts/travis/cmake.sh - bash scripts/travis/vtk.sh + - bash scripts/travis/boost.sh before_script: - export PATH=$HOME/cmake-3.1.1-Linux-x86_64/bin:$PATH diff --git a/Applications/ApplicationsLib/CMakeLists.txt b/Applications/ApplicationsLib/CMakeLists.txt index 540357b05ea..a19c38f0e63 100644 --- a/Applications/ApplicationsLib/CMakeLists.txt +++ b/Applications/ApplicationsLib/CMakeLists.txt @@ -17,3 +17,6 @@ ADD_VTK_DEPENDENCY(ApplicationsLib) if(TARGET Eigen) add_dependencies(ApplicationsLib Eigen) endif() +if(TARGET Boost) + add_dependencies(ApplicationsLib Boost) +endif() diff --git a/scripts/cmake/ExternalProjectBoost.cmake b/scripts/cmake/ExternalProjectBoost.cmake index 2afa6ce4336..0798cca6c9c 100644 --- a/scripts/cmake/ExternalProjectBoost.cmake +++ b/scripts/cmake/ExternalProjectBoost.cmake @@ -5,6 +5,10 @@ if(Boost_FOUND) return() endif() +if(NOT DEFINED BOOST_ROOT AND DEFINED ENV{BOOST_ROOT}) + set(BOOST_ROOT $ENV{BOOST_ROOT} TRUE CACHE PATH "") +endif() + # First check for system boost if(NOT Boost_INCLUDE_DIRS) if(APPLE) @@ -41,6 +45,5 @@ ExternalProject_Get_Property( Boost source_dir ) if(NOT Boost_INCLUDE_DIRS) set( Boost_INCLUDE_DIRS ${source_dir} CACHE INTERNAL "Boost include directories") - # On Visual Studio Boost libs get automatically linked message(STATUS "Downloading Boost ${OGS_BOOST_VERSION} automatically.") endif() diff --git a/scripts/travis/boost.sh b/scripts/travis/boost.sh new file mode 100644 index 00000000000..f5d0f88ca8d --- /dev/null +++ b/scripts/travis/boost.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e +# check to see if boost folder is empty +if [ ! -d "$HOME/boost_1_56_0/boost" ]; then + TAR="boost_1_56_0.tar.gz" + cd $HOME + curl -L -o $TAR http://sourceforge.net/projects/boost/files/boost/1.56.0/$TAR/download; + tar -xzf $TAR; +else + echo 'Using cached boost directory.'; +fi diff --git a/scripts/travis/cmake.sh b/scripts/travis/cmake.sh index 66e68ffffe4..bd2827abe1a 100644 --- a/scripts/travis/cmake.sh +++ b/scripts/travis/cmake.sh @@ -5,7 +5,7 @@ if [ ! -d "$HOME/cmake-3.1.1-Linux-x86_64/bin" ]; then CMAKE_TAR="cmake-3.1.1-Linux-x86_64.tar.gz" cd $HOME curl -L -o $CMAKE_TAR http://www.cmake.org/files/v3.1/$CMAKE_TAR; - tar -xzvf $CMAKE_TAR; + tar -xzf $CMAKE_TAR; else echo 'Using cached cmake directory.'; fi -- GitLab