-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAutoCompileSlicer.script
More file actions
executable file
·67 lines (67 loc) · 1.96 KB
/
AutoCompileSlicer.script
File metadata and controls
executable file
·67 lines (67 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
if [ $# != 1 ]
then
echo "Usage: $0 SlicerRootDir"
exit 1
fi
SlicerRootDir=$1
echo "Slicer root directory: ${SlicerRootDir}"
scriptDIR="$( cd "$( dirname "$0" )" && pwd )"
if [ ! -e "$scriptDIR/ConfigurationVariables.script" ]
then
echo "ConfigurationVariables.script not found. It should be there:"
echo "$scriptDIR/ConfigurationVariables.script"
exit 1
fi
source $scriptDIR/ConfigurationVariables.script
if [ ! -e "$scriptDIR/../Resources/CompileEnvironment.script" ]
then
echo "CompileEnvironment.script not found. It should be there:"
echo "$scriptDIR/../Resources/CompileEnvironment.script"
exit 1
fi
source $scriptDIR/../Resources/CompileEnvironment.script
currentDir=`pwd`
echo "Current directory: ${currentDir}"
cd $SlicerRootDir
#Update
echo "SVN update"
SLICER_SOURCE=Slicer4-trunk
if [ ! -e ${SLICER_SOURCE} ]
then
svn co http://svn.slicer.org/Slicer4/trunk $SLICER_SOURCE
else
cd ${SLICER_SOURCE}
svn update
cd ..
fi
#Recompile
echo "qmake: ${QMAKE}"
echo "cmake: ${CMAKE}"
echo "Build testing: ${BUILD_TESTING}"
echo "cmake_build_type: ${CMAKE_BUILD_TYPE}"
nbThreads=8
echo "#Threads: ${nbThreads}"
BINARY_DIR=Slicer4-trunk-build
if [ -d $BINARY_DIR ]
then
echo "Build directory exists: $BINARY_DIR"
echo "Removing it"
rm -rf $BINARY_DIR
fi
echo "Creating build directory: $BINARY_DIR"
mkdir $BINARY_DIR
cd $BINARY_DIR
VTK_VERSION_MAJOR=6
echo "Configuration"
CC=${CC} CXX=${CXX} ${CMAKE} -DBUILD_TESTING:BOOL=${BUILD_TESTING} \
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QMAKE} \
-DSlicer_USE_PYTHONQT_WITH_OPENSSL:BOOL=ON \
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} \
-DVTK_VERSION_MAJOR:STRING=${VTK_VERSION_MAJOR} \
-DSlicer_USE_VTK_DEBUG_LEAKS:BOOL=OFF \
../${SLICER_SOURCE}
echo "Compilation"
make -j ${nbThreads}
make -C Slicer-build -j ${nbThreads} package
cd $currentDir