.travis.yml 3.97 KB
Newer Older
1
2
language: cpp

3
4
5
env:
  global:
    HOME_DIR=${TRAVIS_BUILD_DIR}/..
6
    ExternalData_OBJECT_STORES=${HOME_DIR}/.ExternalData
7
8
9
10
11
12
13
    ITK_URL=https://github.com/InsightSoftwareConsortium/ITK
    ITK_SOURCE_DIR=${HOME_DIR}/ITK-source
    ITK_BUILD_DIR=${HOME_DIR}/ITK-build
    ELASTIX_URL=https://github.com/SuperElastix/elastix
    ELASTIX_SOURCE_DIR=${HOME_DIR}/Elastix-source
    ELASTIX_BUILD_DIR=${HOME_DIR}/Elastix-build
    SUPERELASTIX_SOURCE_DIR=${TRAVIS_BUILD_DIR}/SuperBuild
Kasper Marstal's avatar
Kasper Marstal committed
14
    SUPERELASTIX_BUILD_DIR=${HOME_DIR}/SuperElastix-build
15
    CMAKE_DOWNLOAD_FILE=cmake-3.6.0-Linux-x86_64.sh
16

17
18
cache:
  directories:
19
    - ${ExternalData_OBJECT_STORES}
20
21
22
23
    - ${ITK_SOURCE_DIR}
    - ${ITK_BUILD_DIR}
    - ${ELASTIX_SOURCE_DIR}
    - ${ELASTIX_BUILD_DIR}
24

25
26
matrix:
  include:
27
28
29
30
31
32
33
34
35
36
37
    - os: linux
      dist: trusty
      sudo: required
      compiler: gcc
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-4.9
      env:
38
         - GCC="CC=gcc-4.9 && CXX=g++-4.9"
39
40
41
42
43
44
45
46
47
48
49
    - os: linux
      dist: trusty
      sudo: required
      compiler: gcc
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-5
      env:
50
         - GCC="CC=gcc-5 && CXX=g++-5"
51
52
53
54
55
56
57
58
59
60
61
    - os: linux
      dist: trusty
      sudo: required
      compiler: gcc
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-6
      env:
62
         - GCC="CC=gcc-6 && CXX=g++-6"
63
64
65
66
67
68
69
70
71
72
73
    - os: linux
      dist: trusty
      sudo: required
      compiler: gcc
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-7
      env:
74
         - GCC="CC=gcc-7 && CXX=g++-7"
75
76
77
78
    - os: osx
      compiler: clang
    - os: osx
      compiler: gcc
79

80
81
82
before_install:
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then eval ${GCC}; fi;

83
before_script:
84
  - mkdir -p ${SUPERELASTIX_BUILD_DIR}
85
86
87
88
  - mkdir -p ${ExternalData_OBJECT_STORES}
  - if [[ "$TRAVIS_OS_NAME" == "linux" && ! -e "${ExternalData_OBJECT_STORES}/${CMAKE_DOWNLOAD_FILE}" ]]; then (cd ${ExternalData_OBJECT_STORES} && curl -sSO https://cmake.org/files/v3.6/${CMAKE_DOWNLOAD_FILE}); fi; 
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo bash "${ExternalData_OBJECT_STORES}/${CMAKE_DOWNLOAD_FILE}" --prefix=/usr/local --exclude-subdir; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake --version; fi
89
90

script:
91
92
93
94
95
96
97
  - if [[ ! -e ${ITK_BUILD_DIR}/ITKConfig.cmake ]]; then
      rm -rf ${ITK_SOURCE_DIR} {ITK_BUILD_DIR} &&
      git clone ${ITK_URL} ${ITK_SOURCE_DIR} &&
      cd ${ITK_SOURCE_DIR} &&
      git checkout v4.12.2 &&
      mkdir -p ${ITK_BUILD_DIR} &&
      cd ${ITK_BUILD_DIR} &&
Kasper Marstal's avatar
Kasper Marstal committed
98
      cmake -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -DCMAKE_VISIBILITY_INLINES_HIDDEN:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_SKIP_RPATH:BOOL=ON -DITK_LEGACY_REMOVE:BOOL=ON -DITK_USE_KWSTYLE:BOOL=OFF -DITK_BUILD_DEFAULT_MODULES:BOOL=ON -DModule_ITKReview:BOOL=ON ${ITK_SOURCE_DIR} &&
99
      make --jobs=4; fi
Kasper Marstal's avatar
Kasper Marstal committed
100
  - if [[ ! -e ${ELASTIX_BUILD_DIR}/ElastixConfig.cmake ]]; then
101
102
103
      rm -rf ${ELASTIX_SOURCE_DIR} ${ELASTIX_BUILD_DIR} &&
      git clone ${ELASTIX_URL} ${ELASTIX_SOURCE_DIR} &&
      cd ${ELASTIX_SOURCE_DIR} &&
Kasper Marstal's avatar
Kasper Marstal committed
104
      git checkout e8354222396c6bd78e9fe6d5a39e4ecac4bb0d52 &&
105
106
107
108
109
110
111
      mkdir -p ${ELASTIX_BUILD_DIR} &&
      cd ${ELASTIX_BUILD_DIR} &&
      cmake -DBUILD_TESTING:BOOL=OFF -DELASTIX_BUILD_EXECUTABLE:BOOL=OFF -DITK_DIR=${ITK_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release ${ELASTIX_SOURCE_DIR} &&
      make --jobs=4 && 
      touch ${HOME_DIR}/built_cache; fi
  - cd ${SUPERELASTIX_BUILD_DIR}
  - if [[ ! -e ${HOME_DIR}/built_cache ]]; then
Kasper Marstal's avatar
Kasper Marstal committed
112
      cmake -DBUILD_APPLICATIONS_EXTERNAL_PROJECT:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_ITK:BOOL=ON -DITK_DIR=${ITK_BUILD_DIR} -DUSE_SYSTEM_ELASTIX:BOOL=ON -DElastix_DIR=${ELASTIX_BUILD_DIR} ${SUPERELASTIX_SOURCE_DIR} && 
113
      make --jobs=4; fi