From e91d72049a4a9aa2faabd8add7f04732fe8eedcc Mon Sep 17 00:00:00 2001 From: tbaudier Date: Tue, 25 Apr 2017 14:49:47 +0200 Subject: [PATCH] Travis: Toward c++11 with vtk --- .travis.yml | 40 ++++++--- travis/travis_build_itk.sh | 22 +++-- travis/travis_build_vtk.sh | 172 +++++++++++++++++++++++++------------ travis/travis_build_vv.sh | 19 ++-- 4 files changed, 177 insertions(+), 76 deletions(-) diff --git a/.travis.yml b/.travis.yml index 046913a..e388cb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,20 +12,33 @@ compiler: - gcc - clang env: - - WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=5.5.1 - - WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 - - WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=5.5.1 - - WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 - - WITH_CMAKE=true VTK_VERSION=5.10 ITK_VERSION=4.5 QT_VERSION=4.8.7 + - WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=5.5.1 C11=false + - WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=false + - WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=5.5.1 C11=false + - WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=false + - WITH_CMAKE=true VTK_VERSION=5.10 ITK_VERSION=4.5 QT_VERSION=4.8.7 C11=false + - WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=5.5.1 C11=true + - WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=true + - WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=5.5.1 C11=true + - WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=true + - WITH_CMAKE=true VTK_VERSION=5.10 ITK_VERSION=4.5 QT_VERSION=4.8.7 C11=true matrix: exclude: - os: osx - env: WITH_CMAKE=true VTK_VERSION=5.10 ITK_VERSION=4.5 QT_VERSION=4.8.7 #VTK5.10 doesn't work with osX + env: WITH_CMAKE=true VTK_VERSION=5.10 ITK_VERSION=4.5 QT_VERSION=4.8.7 C11=false #VTK5.10 doesn't work with osX - os: osx - env: WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 #Qt4 doesn't work with brew anymore + env: WITH_CMAKE=true VTK_VERSION=5.10 ITK_VERSION=4.5 QT_VERSION=4.8.7 C11=true #VTK5.10 doesn't work with osX - os: osx - env: WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 + env: WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=false #Qt4 doesn't work with brew anymore + - os: osx + env: WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=true #Qt4 doesn't work with brew anymore + - os: osx + env: WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=false + - os: osx + env: WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=true + - os: linux + env: WITH_CMAKE=true VTK_VERSION=5.10 ITK_VERSION=4.5 QT_VERSION=4.8.7 C11=true #Problem with VTK 5.10 and c++11 language: cpp @@ -34,6 +47,10 @@ notifications: on_success: never on_failure: never +branches: +only: +- master + before_install: - if test $TRAVIS_OS_NAME == osx ; then brew update; fi - if test $TRAVIS_OS_NAME == linux ; then sudo add-apt-repository --yes ppa:kubuntu-ppa/backports; fi @@ -58,6 +75,8 @@ install: - if test $TRAVIS_OS_NAME == osx ; then export HOMEBREW_QT_VERSION=$(brew list --versions qt | rev | cut -d' ' -f1 | rev); fi - if test $TRAVIS_OS_NAME == osx ; then if [[ "$QT_VERSION" == "5.5.1" ]] ; then ln -s /usr/local/Cellar/qt@5.5/5.5.1_1/mkspecs /usr/local/mkspecs; fi; fi - if test $TRAVIS_OS_NAME == osx ; then if [[ "$QT_VERSION" == "5.5.1" ]] ; then ln -s /usr/local/Cellar/qt@5.5/5.5.1_1/plugins /usr/local/plugins; fi; fi +- if test $TRAVIS_OS_NAME == osx ; then if [[ "$QT_VERSION" == "4.8.7" ]] ; then ln -s /usr/local/Cellar/qt@4/4.8.7_1/mkspecs /usr/local/mkspecs; fi; fi +- if test $TRAVIS_OS_NAME == osx ; then if [[ "$QT_VERSION" == "4.8.7" ]] ; then ln -s /usr/local/Cellar/qt@4/4.8.7_1/plugins /usr/local/plugins; fi; fi - if test $TRAVIS_OS_NAME == osx ; then qmake -v; fi cache: @@ -76,10 +95,11 @@ cache: before_script: - if test $TRAVIS_OS_NAME == linux ; then sudo ln -s /usr/bin/x86_64-linux-gnu/libpq.so /usr/bin/libpq.so; fi +- echo $PATH - $SCRIPTS/travis_build_vtk.sh -- $SCRIPTS/travis_build_itk.sh +#- $SCRIPTS/travis_build_itk.sh #Install vtk and itk (different version) script: - echo "coucou"; -- $SCRIPTS/travis_build_vv.sh +#- $SCRIPTS/travis_build_vv.sh diff --git a/travis/travis_build_itk.sh b/travis/travis_build_itk.sh index 5bcc4c0..ee0fc25 100755 --- a/travis/travis_build_itk.sh +++ b/travis/travis_build_itk.sh @@ -3,12 +3,22 @@ set -ev MAKE="make --jobs=$NUM_THREADS --keep-going" #Prepare cmake arguments following the ITK version -if [ "$ITK_VERSION" == "4.5" ]; then -itk_repo_str=" --branch v4.5.0 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1" -cmake_arg_str=" -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DModule_ITKReview=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF " -elif [ "$ITK_VERSION" == "4.9.1" ]; then -itk_repo_str=" --branch v4.9.1 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1" -cmake_arg_str=" -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DModule_ITKReview=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF " +if [ "$C11" == "true" ]; then + if [ "$ITK_VERSION" == "4.5" ]; then + itk_repo_str=" --branch v4.5.0 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1" + cmake_arg_str=" -DCMAKE_CXX_FLAGS=-std=c++11 -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DModule_ITKReview=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF " + elif [ "$ITK_VERSION" == "4.9.1" ]; then + itk_repo_str=" --branch v4.9.1 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1" + cmake_arg_str=" -DCMAKE_CXX_FLAGS=-std=c++11 -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DModule_ITKReview=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF " + fi +else + if [ "$ITK_VERSION" == "4.5" ]; then + itk_repo_str=" --branch v4.5.0 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1" + cmake_arg_str=" -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DModule_ITKReview=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF " + elif [ "$ITK_VERSION" == "4.9.1" ]; then + itk_repo_str=" --branch v4.9.1 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1" + cmake_arg_str=" -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DModule_ITKReview=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF " + fi fi if [ -d $ITK_SOURCE_DIR ]; then diff --git a/travis/travis_build_vtk.sh b/travis/travis_build_vtk.sh index f7b1fce..f4dbf32 100755 --- a/travis/travis_build_vtk.sh +++ b/travis/travis_build_vtk.sh @@ -9,61 +9,123 @@ elif [ "$QT_VERSION" == "5.5.1" ]; then fi #Prepare cmake arguments following the VTK version -if [ "$VTK_VERSION" == "5.10" ]; then -vtk_repo_str=" --branch v5.10.0 https://github.com/Kitware/VTK.git --depth 1" -cmake_arg_str=" $cmake_arg_str - -DBUILD_SHARED_LIBS=1 - -DCMAKE_BUILD_TYPE=Release - -DBUILD_TESTING=0 - -DBUILD_EXAMPLES=0 - -DBUILD_DOCUMENTATION=0 - -DVTK_USE_QT=ON - -DVTK_USE_RENDERING=ON - -DVTK_USE_VIEWS=ON - -DVTK_QT_VERSION="$QT_MAJOR_VERSION" " -elif [ "$VTK_VERSION" == "6.3" ]; then -vtk_repo_str=" --branch v6.3.0 https://github.com/Kitware/VTK.git --depth 1" -cmake_arg_str=" $cmake_arg_str - -DBUILD_SHARED_LIBS=1 - -DCMAKE_BUILD_TYPE=Release - -DBUILD_TESTING=0 - -DBUILD_EXAMPLES=0 - -DBUILD_DOCUMENTATION=0 - -DVTK_Group_StandAlone=ON - -DVTK_Group_Imaging=OFF - -DVTK_Group_MPI=OFF - -DVTK_Group_Rendering=ON - -DVTK_Group_Tk=OFF - -DVTK_Group_Views=OFF - -DVTK_Group_Web=OFF - -DModule_vtkGUISupportQt=ON - -DModule_vtkGUISupportQtOpenGL=ON - -DModule_vtkGUISupportQtSQL=ON - -DModule_vtkRenderingQt=ON - -DModule_vtkViewsQt=ON - -DVTK_QT_VERSION="$QT_MAJOR_VERSION" " -elif [ "$VTK_VERSION" == "7.0.0" ]; then -vtk_repo_str=" --branch v7.0.0 https://github.com/Kitware/VTK.git --depth 1" -cmake_arg_str=" $cmake_arg_str - -DBUILD_SHARED_LIBS=1 - -DCMAKE_BUILD_TYPE=Release - -DBUILD_TESTING=0 - -DBUILD_EXAMPLES=0 - -DBUILD_DOCUMENTATION=0 - -DVTK_Group_StandAlone=ON - -DVTK_Group_Imaging=OFF - -DVTK_Group_MPI=OFF - -DVTK_Group_Rendering=ON - -DVTK_Group_Tk=OFF - -DVTK_Group_Views=OFF - -DVTK_Group_Web=OFF - -DVTK_RENDERING_BACKEND=OpenGL - -DModule_vtkGUISupportQt=ON - -DModule_vtkGUISupportQtOpenGL=ON - -DModule_vtkGUISupportQtSQL=ON - -DModule_vtkRenderingQt=ON - -DModule_vtkViewsQt=ON - -DVTK_QT_VERSION="$QT_MAJOR_VERSION" " +if [ "$C11" == "true" ]; then + if [ "$VTK_VERSION" == "5.10" ]; then + vtk_repo_str=" --branch v5.10.0 https://github.com/Kitware/VTK.git --depth 1" + cmake_arg_str=" $cmake_arg_str + -DCMAKE_CXX_FLAGS=-std=c++11 + -DBUILD_SHARED_LIBS=1 + -DCMAKE_BUILD_TYPE=Release + -DBUILD_TESTING=0 + -DBUILD_EXAMPLES=0 + -DBUILD_DOCUMENTATION=0 + -DVTK_USE_QT=ON + -DVTK_USE_RENDERING=ON + -DVTK_USE_VIEWS=ON + -DVTK_QT_VERSION="$QT_MAJOR_VERSION" " + elif [ "$VTK_VERSION" == "6.3" ]; then + vtk_repo_str=" --branch v6.3.0 https://github.com/Kitware/VTK.git --depth 1" + cmake_arg_str=" $cmake_arg_str + -DCMAKE_CXX_FLAGS=-std=c++11 + -DBUILD_SHARED_LIBS=1 + -DCMAKE_BUILD_TYPE=Release + -DBUILD_TESTING=0 + -DBUILD_EXAMPLES=0 + -DBUILD_DOCUMENTATION=0 + -DVTK_Group_StandAlone=ON + -DVTK_Group_Imaging=OFF + -DVTK_Group_MPI=OFF + -DVTK_Group_Rendering=ON + -DVTK_Group_Tk=OFF + -DVTK_Group_Views=OFF + -DVTK_Group_Web=OFF + -DModule_vtkGUISupportQt=ON + -DModule_vtkGUISupportQtOpenGL=ON + -DModule_vtkGUISupportQtSQL=ON + -DModule_vtkRenderingQt=ON + -DModule_vtkViewsQt=ON + -DVTK_QT_VERSION="$QT_MAJOR_VERSION" " + elif [ "$VTK_VERSION" == "7.0.0" ]; then + vtk_repo_str=" --branch v7.0.0 https://github.com/Kitware/VTK.git --depth 1" + cmake_arg_str=" $cmake_arg_str + -DCMAKE_CXX_FLAGS=-std=c++11 + -DBUILD_SHARED_LIBS=1 + -DCMAKE_BUILD_TYPE=Release + -DBUILD_TESTING=0 + -DBUILD_EXAMPLES=0 + -DBUILD_DOCUMENTATION=0 + -DVTK_Group_StandAlone=ON + -DVTK_Group_Imaging=OFF + -DVTK_Group_MPI=OFF + -DVTK_Group_Rendering=ON + -DVTK_Group_Tk=OFF + -DVTK_Group_Views=OFF + -DVTK_Group_Web=OFF + -DVTK_RENDERING_BACKEND=OpenGL + -DModule_vtkGUISupportQt=ON + -DModule_vtkGUISupportQtOpenGL=ON + -DModule_vtkGUISupportQtSQL=ON + -DModule_vtkRenderingQt=ON + -DModule_vtkViewsQt=ON + -DVTK_QT_VERSION="$QT_MAJOR_VERSION" " + fi +else + if [ "$VTK_VERSION" == "5.10" ]; then + vtk_repo_str=" --branch v5.10.0 https://github.com/Kitware/VTK.git --depth 1" + cmake_arg_str=" $cmake_arg_str + -DBUILD_SHARED_LIBS=1 + -DCMAKE_BUILD_TYPE=Release + -DBUILD_TESTING=0 + -DBUILD_EXAMPLES=0 + -DBUILD_DOCUMENTATION=0 + -DVTK_USE_QT=ON + -DVTK_USE_RENDERING=ON + -DVTK_USE_VIEWS=ON + -DVTK_QT_VERSION="$QT_MAJOR_VERSION" " + elif [ "$VTK_VERSION" == "6.3" ]; then + vtk_repo_str=" --branch v6.3.0 https://github.com/Kitware/VTK.git --depth 1" + cmake_arg_str=" $cmake_arg_str + -DBUILD_SHARED_LIBS=1 + -DCMAKE_BUILD_TYPE=Release + -DBUILD_TESTING=0 + -DBUILD_EXAMPLES=0 + -DBUILD_DOCUMENTATION=0 + -DVTK_Group_StandAlone=ON + -DVTK_Group_Imaging=OFF + -DVTK_Group_MPI=OFF + -DVTK_Group_Rendering=ON + -DVTK_Group_Tk=OFF + -DVTK_Group_Views=OFF + -DVTK_Group_Web=OFF + -DModule_vtkGUISupportQt=ON + -DModule_vtkGUISupportQtOpenGL=ON + -DModule_vtkGUISupportQtSQL=ON + -DModule_vtkRenderingQt=ON + -DModule_vtkViewsQt=ON + -DVTK_QT_VERSION="$QT_MAJOR_VERSION" " + elif [ "$VTK_VERSION" == "7.0.0" ]; then + vtk_repo_str=" --branch v7.0.0 https://github.com/Kitware/VTK.git --depth 1" + cmake_arg_str=" $cmake_arg_str + -DBUILD_SHARED_LIBS=1 + -DCMAKE_BUILD_TYPE=Release + -DBUILD_TESTING=0 + -DBUILD_EXAMPLES=0 + -DBUILD_DOCUMENTATION=0 + -DVTK_Group_StandAlone=ON + -DVTK_Group_Imaging=OFF + -DVTK_Group_MPI=OFF + -DVTK_Group_Rendering=ON + -DVTK_Group_Tk=OFF + -DVTK_Group_Views=OFF + -DVTK_Group_Web=OFF + -DVTK_RENDERING_BACKEND=OpenGL + -DModule_vtkGUISupportQt=ON + -DModule_vtkGUISupportQtOpenGL=ON + -DModule_vtkGUISupportQtSQL=ON + -DModule_vtkRenderingQt=ON + -DModule_vtkViewsQt=ON + -DVTK_QT_VERSION="$QT_MAJOR_VERSION" " + fi fi if [ -d $VTK_SOURCE_DIR ]; then diff --git a/travis/travis_build_vv.sh b/travis/travis_build_vv.sh index 797b03c..5472076 100755 --- a/travis/travis_build_vv.sh +++ b/travis/travis_build_vv.sh @@ -3,11 +3,20 @@ set -ev MAKE="make --jobs=$NUM_THREADS --keep-going" #Prepare cmake arguments following the vv version -cmake_arg_str=" -DCLITK_BUILD_REGISTRATION=OFF --DCLITK_BUILD_SEGMENTATION=OFF --DCLITK_BUILD_TOOLS=OFF --DCLITK_BUILD_VV=ON --DCLITK_EXPERIMENTAL=OFF" +if [ "$C11" == "true" ]; then + cmake_arg_str=" -DCMAKE_CXX_FLAGS=-std=c++11 + -DCLITK_BUILD_REGISTRATION=OFF + -DCLITK_BUILD_SEGMENTATION=OFF + -DCLITK_BUILD_TOOLS=OFF + -DCLITK_BUILD_VV=ON + -DCLITK_EXPERIMENTAL=OFF" +else + cmake_arg_str=" -DCLITK_BUILD_REGISTRATION=OFF + -DCLITK_BUILD_SEGMENTATION=OFF + -DCLITK_BUILD_TOOLS=OFF + -DCLITK_BUILD_VV=ON + -DCLITK_EXPERIMENTAL=OFF" +fi #CMAKE and MAKE mkdir -p $BUILD_DIR -- 2.47.1