-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathcmake_mac_os.sh
More file actions
executable file
·64 lines (52 loc) · 1.18 KB
/
cmake_mac_os.sh
File metadata and controls
executable file
·64 lines (52 loc) · 1.18 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
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
BDIR=build
GENERATOR=
COMPILER=
BUILD_TYPE=-DCMAKE_BUILD_TYPE=Release
OPTIONS=
function base() {
#echo "Setup:"
#echo "COMPILER=$COMPILER"
#echo "GENERATOR=$GENERATOR"
#echo "BDIR=$BDIR"
cmake -H. -B$BDIR \
-DBISON_EXECUTABLE=/usr/local/Cellar/bison/3.2.2/bin/bison \
-DFLEX_EXECUTABLE=/usr/local/Cellar/flex/2.6.4/bin/flex \
-DCPPAN_EXECUTABLE=`which cppan` \
$COMPILER \
$GENERATOR \
$BUILD_TYPE \
$OPTIONS \
$*
}
function xcode() {
BDIR="${BDIR}_xcode"
GENERATOR="-GXcode"
OPTIONS="-DCPPAN_USE_CACHE=0"
}
function gcc() {
BDIR="${BDIR}_gcc8"
COMPILER="-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8"
}
function clang() {
BDIR="${BDIR}_clang"
CLANG=/usr/local/Cellar/llvm/7.0.0/bin/clang
COMPILER="-DCMAKE_C_COMPILER=$CLANG -DCMAKE_CXX_COMPILER=$CLANG++"
}
function ninja() {
BDIR="${BDIR}_ninja"
GENERATOR="-GNinja"
}
function debug() {
BDIR="${BDIR}_debug"
BUILD_TYPE=-DCMAKE_BUILD_TYPE=Debug
}
function release() {
#BDIR="${BDIR}_release"
BUILD_TYPE=-DCMAKE_BUILD_TYPE=Release
}
for i in "$@"; do
eval $i
done
base
echo $BDIR