-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
57 lines (39 loc) · 1.4 KB
/
init.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
#!/bin/bash
red='\033[0;31m'
green='\033[0;32m'
reset='\033[0m'
##sorry for not puting this in Cmake ......... ............ for app02 cube game
function is_package_installed() {
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -q "install ok installed"
}
# Install packages if not already installed
function install_packages() {
local packages=("$@")
local missing_packages=()
for package in "${packages[@]}"; do
if ! is_package_installed "$package"; then
missing_packages+=("$package")
fi
done
if [[ ${#missing_packages[@]} -gt 0 ]]; then
echo "Installing missing packages: ${missing_packages[@]}"
sudo apt-get update
sudo apt-get install "${missing_packages[@]}"
else
echo "All required packages are already installed."
fi
}
root=$(pwd)
dirs=(app00_BusinessRetail app01_Health app02_VideoLibrary)
echo "Creatig builds...\n"
for dir in "${dirs[@]}"
do
cd "$root/$dir" || { echo "Failed to enter directory $dir"; continue; }
cd build || { echo "Failed to enter $dir/build"; continue; }
cmake -S . -B .
cmake --build .
done
echo "\n${green}Done.\n"
echo "3${reset} Applications created.\n${green}1: ./bank ${reset} inside app00_BusinessRetail\n${green}2: ./health ${reset}inside app01_Health\n${green}3: ./library ${reset}inside app02_VideoLibrary."
echo "\n"
apt-get install gcc make xorg libxext-dev libbsd-dev