forked from tudelft3d/City3D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path00_rebuild_city3d_and_easy3d.sh
71 lines (57 loc) · 1.61 KB
/
00_rebuild_city3d_and_easy3d.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
#!/usr/bin/env bash
# This script build City3D and Easy3D executables
BUILD_DIR="Release"
CGAL_VERSION="5.5.2"
EASY3D_VERSION="2.5.2"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# Download CGAL and Easy3D
# CGAL will be used as header only
# Easy3D needs to be built
# Remove directory to force fresh compilation
# rm -rf "CGAL-$CGAL_VERSION"
rm -rf "Easy3D-$EASY3D_VERSION"
cd $SCRIPT_DIR
if [ ! -d "CGAL-$CGAL_VERSION" ]
then
wget "https://github.com/CGAL/cgal/releases/download/v$CGAL_VERSION/CGAL-$CGAL_VERSION.tar.xz" .
tar -xf CGAL-$CGAL_VERSION.tar.xz
rm CGAL-$CGAL_VERSION.tar.xz
fi
if [ ! -d "Easy3D-$EASY3D_VERSION" ]
then
# wget "https://github.com/LiangliangNan/Easy3D/archive/refs/tags/v$EASY3D_VERSION.tar.gz" .
# tar -xf v$EASY3D_VERSION.tar.gz
# rm v$EASY3D_VERSION.tar.gz
# For now get the latest version of main branch containing fixes we require
git clone [email protected]:LiangliangNan/Easy3D.git "Easy3D-$EASY3D_VERSION"
fi
# Build Easy3D
cd Easy3D-$EASY3D_VERSION
if [ -d "$BUILD_DIR" ]
then
rm -rf $BUILD_DIR
fi
mkdir $BUILD_DIR
cd $BUILD_DIR
cmake -DCMAKE_BUILD_TYPE=Release -DEasy3D_ENABLE_CGAL=ON -DCGAL_DIR=$SCRIPT_DIR/CGAL-$CGAL_VERSION ..
make -j$(($(nproc)))
# Build City3D
cd $SCRIPT_DIR
if [ -d "$BUILD_DIR" ]
then
rm -rf $BUILD_DIR
fi
mkdir $BUILD_DIR
cd $BUILD_DIR
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(($(nproc)))
# Build Easy3D fix executable
cd $SCRIPT_DIR/CLI_Easy3D_Fix
if [ -d "$BUILD_DIR" ]
then
rm -rf $BUILD_DIR
fi
mkdir $BUILD_DIR
cd $BUILD_DIR
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(($(nproc)))