-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_release_macos.sh
executable file
·67 lines (54 loc) · 1.39 KB
/
build_release_macos.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
#!/bin/bash
OS=$(uname)
if [ "$OS" != "Darwin" ]; then
echo "Ce script doit être exécuté uniquement sur macOS!"
exit 1
fi
# clean
echo "Clean du répertoire, nottament des fichiers ignoré par .gitignore"
if [ -d "_deps" ]; then
rm -rf _deps
fi
if [ -d "OctaSplit_artefacts" ]; then
rm -rf OctaSplit_artefacts
fi
if [ -d "CMakeFiles" ]; then
rm -rf CMakeFiles
fi
if [[ -f "./build.ninja" ]]; then
rm "./build.ninja"
fi
if [[ -f "./cmake_install.cmake" ]]; then
rm "./cmake_install.cmake"
fi
if [[ -f "./CMakeCache.txt" ]]; then
rm "./CMakeCache.txt"
fi
if [[ -f "./CPackConfig.cmake" ]]; then
rm "./CPackConfig.cmake"
fi
if [[ -f "./CPackSourceConfig.cmake" ]]; then
rm "./CPackSourceConfig.cmake"
fi
# Supprimer le dossier de build s'il existe
if [ -d "build" ]; then
rm -rf build
fi
# Créer un dossier de build si il n'existe pas
mkdir -p build
cd build
# Supprimer le répertoire 'bin' s'il existe
if [ -d "bin" ]; then
rm -r bin
fi
# Générer les fichiers de projet avec CMake
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64" ..
#cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" ..
# Compiler le projet
cmake --build . --config Release
mkdir bin
cp -rf ./OctaSplit_artefacts/Release/OctaSplit.app ./bin/OctaSplit.app
cd bin
mkdir installer
create-dmg 'OctaSplit.app' ./installer
echo "Compilation terminée."