]> Creatis software - clitk.git/commitdiff
Travis: Toward c++11 with vtk
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Tue, 25 Apr 2017 12:49:47 +0000 (14:49 +0200)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Tue, 25 Apr 2017 12:49:47 +0000 (14:49 +0200)
.travis.yml
travis/travis_build_itk.sh
travis/travis_build_vtk.sh
travis/travis_build_vv.sh

index 046913a1819a65b1d70094a98bd743e371dcd9bb..e388cb66fe77630d72faa2cc595178aa019f0e61 100644 (file)
@@ -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
index 5bcc4c03a872571895b1b431d0082e448ee5917c..ee0fc2597572630ad1611bf70e6c80fe889fce11 100755 (executable)
@@ -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
index f7b1fce56d102385b1cdf1bd1f29695f4c074d02..f4dbf32532edc1766cabc8ada6d2ff99a86cf66f 100755 (executable)
@@ -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
index 797b03cc7077d6568d342fafbf8b0f6dcd46d049..54720764e6cd7a44b8b7c60e2914e47117feb319 100755 (executable)
@@ -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