-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_submodules_and_configure
executable file
·88 lines (78 loc) · 2.71 KB
/
update_submodules_and_configure
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env bash
# Copyright (C) 2014, 2015 Igor Kushnir <igorkuo AT Google mail>
# License: GPL v3+ (http://www.gnu.org/copyleft/gpl.html)
# update_submodules_and_configure: inits and updates Venturous git submodules;
# gets necessary png icons; configures build.
set -e
print_help()
{
echo 'This script accepts the following options:
"download-png", "generate-png", "qt4", "qt5", "help", "--".'
echo '"download-png" is assumed if not specified.'
echo 'Options that appear later override preceding ones.'
echo 'Options after "--" are ignored.'
echo 'Option may be prefixed with "--" (GNU-style long-options) or not, your choice.'
exit 1
}
matches()
{
[[ ("$1" == "$2") || ("$1" == "--$2") ]]
}
generate_png=false
qt4=false
qt5=false
for arg in "$@"
do
if matches "$arg" "download-png" ; then
generate_png=false
elif matches "$arg" "generate-png" ; then
generate_png=true
elif matches "$arg" "qt4" ; then
qt4=true
qt5=false
elif matches "$arg" "qt5" ; then
qt4=false
qt5=true
elif matches "$arg" "help" ; then
print_help
elif [[ "$arg" == "--" ]] ; then
break
else
echo "Unrecognized option: $arg"
print_help
fi
done
git submodule init
git submodule update
cd modules/vedgTools/QtXmlUtilities
git submodule init TemplateUtilities
git submodule update TemplateUtilities
cd ../../..
script_path="resources/SimpleFugue"
if [[ "$generate_png" == true ]] ; then
"$script_path/generate_png"
else
"$script_path/download_png"
fi
dir_name=build
mkdir -p $dir_name
cd $dir_name
if [[ "$qt4" == true ]] ; then
args="-DFORCE_QT4=ON"
elif [[ "$qt5" == true ]] ; then
args="-DFORCE_QT4=OFF"
else
args=""
fi
cmake "$args" -DCMAKE_BUILD_TYPE=Release -Wno-dev ..
echo ''
echo 'Default configuration is complete. Follow instructions below to install Venturous:'
echo '1. Enter build directory (type "cd build").'
echo '2. If you wish to change default configuration, type "cmake -L .", and you will see the list of options.'
echo ' If you want to see option descriptions, type "cmake -LH .".'
echo ' Type "cmake -D<option name>=<value> ." in order to change some option.'
echo ' For example: "cmake -DFORCE_QT4=ON ." turns on FORCE_QT4 option.'
echo ' Alternatively, if you have cmake-gui installed, you could type "cmake-gui ." and use GUI configuration tool.'
echo ' If you are happy with default configuration, skip this step.'
echo '3. After you are done configuring (or skipped configuration step), type "make -j 2" (you can replace "2" with the number of processor cores to speed up a build process).'
echo '4. Acquire root privileges ("sudo" or "su") and type "make install" to install Venturous.'