-
Notifications
You must be signed in to change notification settings - Fork 14
/
BuildFLIMfit.sh
executable file
·72 lines (54 loc) · 1.86 KB
/
BuildFLIMfit.sh
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
68
69
70
71
72
#!/bin/bash
if [ -z ${MATLAB_VER+x} ]; then export MATLAB_VER=R2020a; echo "Setting MATLAB_VER=R2019b"; fi
triplet=x64-osx
toolchain_file=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake
# Build FlimReader Mex file
#--------------------------------------------
project_dir=GeneratedProjects/FlimReaderUnix
echo "Cleaning CMake Project..."
rm -rf ${project_dir}
mkdir -p ${project_dir}
cur_dir=$(grealpath .)
echo "Generating CMake Project..."
if ! cmake -HFLIMfitLibrary/FLIMreader -B${project_dir} -G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE="${toolchain_file}" -DVCPKG_TARGET_TRIPLET=${triplet} \
-DFlimReaderMEX_OUT_DIR=${cur_dir}/FLIMfitFrontEnd/Libraries/; then
echo 'Error generating project'
exit 1
fi
echo "Building Project..."
if ! cmake --build ${project_dir}; then
echo 'Error building project'
exit 1
fi
# Build FLIMfit library
#--------------------------------------------
echo "Cleaning CMake Project..."
rm -rf GeneratedProjects/Unix
mkdir -p GeneratedProjects/Unix
cur_dir=$(grealpath .)
echo "Generating CMake Project..."
if ! cmake -H. -BGeneratedProjects/Unix -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE; then
echo 'Error generating project'
exit 1
fi
echo "Building Project..."
if ! cmake --build GeneratedProjects/Unix; then
echo 'Error building project'
exit 1
fi
export PATH=/Applications/MATLAB_${MATLAB_VER}.app/bin:$PATH
# compile the Matlab code to generate the FLIMfit_MACI64.app
if [ -z ${VERSION+x} ]; then export VERSION=$(git describe); fi
echo "VERSION = $VERSION"
rm -rf FLIMfitStandalone/BuiltApps/*.app
cur_dir=$(grealpath .)
if ! matlab -nodisplay -nosplash -r "cd('${cur_dir}/FLIMfitFrontEnd'); compile(true); exit"; then
echo 'Error building frontend'
exit 1
fi
cd FLIMfitStandalone/BuiltApps
zip -r FLIMfit_${VERSION}_MACI64.zip *.app/
cd ../..
echo "Build complete"