-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCompileSlicer.script
More file actions
executable file
·65 lines (64 loc) · 1.5 KB
/
CompileSlicer.script
File metadata and controls
executable file
·65 lines (64 loc) · 1.5 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
#!/bin/bash
currentDir=`pwd`
if [ $# -lt 0 ] || [ $# -gt 1 ]
then
echo "Usage: $0 [SVNrevision#]"
exit 1
fi
echo "Current directory: $currentDir"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
resourceFile=$DIR/../Resources/CompileSlicerArgs.txt
if [ ! -e $resourceFile ]
then
echo "Resource file ($resourceFile) not found"
echo "Resource file contains: 1)Slicer root directory"
exit 1
fi
source $DIR/ConfigurationVariables.script
source $DIR/../Resources/CompileEnvironment.script
echo "Resource file: $resourceFile"
resources=(`less $resourceFile`)
rootDir=${resources[0]}
echo "qmake: $QMAKE"
if [ ! -d $rootDir ]
then
mkdir $rootDir
fi
if [ $# -eq 1 ]
then
rev=$1
echo "Revision: $rev"
sourceDir=$rootDir/Slicer-r${rev}
echo "Source Dir: $sourceDir"
if [ ! -d $sourceDir ]
then
mkdir $sourceDir
fi
svn co http://svn.slicer.org/Slicer4/trunk $sourceDir -r $rev
else
rev=""
sourceDir=$rootDir/Slicer-trunk
echo "Source Dir: $sourceDir"
if [ ! -d $sourceDir ]
then
mkdir $sourceDir
fi
svn co http://svn.slicer.org/Slicer4/trunk $sourceDir
fi
binaryDir=$sourceDir"-build"
echo "Binary Dir: $binaryDir"
if [ ! -d $binaryDir ]
then
mkdir $binaryDir
fi
system=`uname`
if [ "$system" == "Darwin" ]
then
extraArgs="-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.10"
fi
cd $binaryDir
echo "Configuring"
cmake -DQT_QMAKE_EXECUTABLE:PATH=$QMAKE -DSlicer_USE_VTK_DEBUG_LEAKS:BOOL=OFF -DSlicer_USE_PYTHONQT_WITH_OPENSSL:BOOL=ON $extraArgs $sourceDir
echo "Building"
make -j3
cd $currentDir