Skip to content

Commit

Permalink
ci: Consider env variables in Travis CI settings
Browse files Browse the repository at this point in the history
  • Loading branch information
schuhschuh committed Sep 21, 2020
1 parent 7dfb4b6 commit 237b09b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ env:
# versions of VTK for each OS
# - On Ubuntu, use default version installed by apt-get
# - On macOS, build recent VTK version from sources and cache installation
- LINUX_VTK_VERSION=6.0.0
- MACOS_VTK_VERSION=9.0 # Homebrew versions: 8.2, 9.0; otherwise build from sources
- WITH_CCACHE=ON # speed up MIRTK build itself using ccache
- WITH_ARPACK=OFF # requires time consuming build of gcc on macOS
- WITH_UMFPACK=OFF # ARPACK & UMFPACK dependencies come in pairs
- WITH_TBB=ON # build with TBB is always recommended
- WITH_FLANN=ON # build with FLANN is optional, but requires only little extra build time
- WITH_FLTK=ON # build with FLTK-based Viewer when WITH_VTK is turned ON
- WITH_ITK=OFF # required by ANTs N4 which is included in DrawEM package
- VTK_VERSION_LINUX=${VTK_VERSION_LINUX:-6.0.0} # trusty: 6.0.0, xenial: 6.2.0, bionic: 6.3.0, 7.1.1
- VTK_VERSION_MACOS=${VTK_VERSION_MACOS:-9.0} # Homebrew versions: 8.2, 9.0; otherwise build from sources
- WITH_CCACHE=${WITH_CCACHE:-ON} # speed up MIRTK build itself using ccache
- WITH_ARPACK=${WITH_ARPACK:-OFF} # requires time consuming build of gcc on macOS
- WITH_UMFPACK=${WITH_UMFPACK:-OFF} # ARPACK & UMFPACK dependencies come in pairs
- WITH_TBB=${WITH_TBB:-ON} # build with TBB is always recommended
- WITH_FLANN=$(WITH_FLANN:-ON} # build with FLANN is optional, but requires only little extra build time
- WITH_FLTK=${WITH_FLTK:-ON} # build with FLTK-based Viewer when WITH_VTK is turned ON
- WITH_ITK=${WITH_ITK:-OFF} # required by ANTs N4 which is included in DrawEM package
# exclude DrawEM from Travis CI build for now, see https://github.com/MIRTK/DrawEM/pull/27
# build and deployment of AppImage for Linux
- AppImage_BUILD=${AppImage_BUILD:-ON}
Expand Down Expand Up @@ -65,8 +65,8 @@ cache:
ccache: true
timeout: 1000
directories:
- "$HOME/VTK-$LINUX_VTK_VERSION"
- "$HOME/VTK-$MACOS_VTK_VERSION"
- "$HOME/VTK-$VTK_VERSION_LINUX"
- "$HOME/VTK-$VTK_VERSION_MACOS"

before_install:
- . Scripts/install_depends.sh # sourcing will enable export of env variables
Expand Down
6 changes: 3 additions & 3 deletions Scripts/install_depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ if [ $os = linux ] || [ $os = Linux ]; then
fi

if [ $WITH_VTK = ON ]; then
if [ -n "$LINUX_VTK_VERSION" ]; then
VTK_VERSION="$LINUX_VTK_VERSION"
if [ -n "$VTK_VERSION_LINUX" ]; then
VTK_VERSION="$VTK_VERSION_LINUX"
fi
if [ "$DISTRIB_CODENAME" = "trusty" ]; then
if [ -z "$VTK_VERSION" ] || [ $VTK_VERSION = '6.0.0' ]; then
Expand Down Expand Up @@ -182,7 +182,7 @@ if [ $os = osx ] || [ $os = Darwin ]; then
brew_install suite-sparse
fi
if [ $WITH_VTK = ON ]; then
VTK_VERSION="$MACOS_VTK_VERSION"
VTK_VERSION="$VTK_VERSION_MACOS"
if [ -z "$VTK_VERSION" ]; then
echo "Installing VTK using Homebrew"
brew_install vtk
Expand Down
4 changes: 2 additions & 2 deletions Scripts/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ if [ $WITH_VTK = ON ]; then
modules=(${modules[@]} Viewer)
fi
if [ $os = osx ] || [ $os = Darwin ]; then
if [ -d "/usr/local/opt/vtk@$MACOS_VTK_VERSION" ]; then
cmake_args+=(-D DEPENDS_VTK_DIR="/usr/local/opt/vtk@$MACOS_VTK_VERSION")
if [ -d "/usr/local/opt/vtk@$VTK_VERSION_MACOS" ]; then
cmake_args+=(-D DEPENDS_VTK_DIR="/usr/local/opt/vtk@$VTK_VERSION_MACOS")
fi
fi
fi
Expand Down

0 comments on commit 237b09b

Please sign in to comment.