-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_separately.sh
More file actions
executable file
·54 lines (41 loc) · 1.15 KB
/
build_separately.sh
File metadata and controls
executable file
·54 lines (41 loc) · 1.15 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
#!/bin/bash
set -e # exit on error
# Root directory of your repo
ROOT_DIR="$(pwd)"
# Where to install all packages
INSTALL_PREFIX="$ROOT_DIR/install"
echo "=============================="
echo "Install folder: $INSTALL_PREFIX"
echo "=============================="
# List of packages in order
PACKAGES=(
"roboptim-core"
"roboptim-core-plugin-ipopt"
"roboptim-capsule"
"robot_capsule_generator"
)
#source paths
source ./source_paths.sh
# Optional: clean previous install
sudo rm -rf "$INSTALL_PREFIX"
# Loop over packages
for PKG in "${PACKAGES[@]}"; do
echo "=============================="
echo "Building and installing $PKG"
echo "=============================="
PKG_DIR="$ROOT_DIR/$PKG"
BUILD_DIR="$PKG_DIR/build"
# Create build directory
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
# Configure with CMake
cmake "$PKG_DIR" -DDISABLE_TESTS=ON -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX"
# Build
cmake --build . -- -j$(nproc)
# Install
sudo cmake --install .
# Return to root dir
cd "$ROOT_DIR"
source ./source_paths.sh
done
echo "All packages built and installed to $INSTALL_PREFIX"