-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.cmake.sh
executable file
·69 lines (51 loc) · 1.46 KB
/
build.cmake.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
68
#!/usr/bin/env bash
cd `pwd`
PORT=8080
#echo ${!#}
if [[ $1 == "-p" ]];then
PORT=${!#}
#echo $PORT
fi
VOSTRO=$(lsof -i -n -P | grep $PORT | grep vostro)
if [[ "$VOSTRO" == *"vostro"* ]]; then
echo "vostro already using port:$PORT" && exit;
fi
##absolute path of script
SCRIPT=$(realpath -s "$0")
##directory script is in
SCRIPTPATH=$(dirname "$SCRIPT")
SCRIPT_PATH="${BASH_SOURCE}"
#echo $SCRIPT
echo $SCRIPTPATH
#echo $SCRIP_TPATH
WX_PREFIX=$($(which wx-config) --prefix)
export WX_PREFIX
if [[ "$OSTYPE" == "msys" ]]; then
dir=$PWD
fi
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
cmake . -DWT_INCLUDE="${WX_PREFIX}/lib/include" -DWT_CONFIG_H="${WX_PREFIX}/include" -DBUILD_WEB=ON -DBUILD_GUI=ON
elif [[ "$OSTYPE" == "darwin"* ]]; then
cmake . -DWT_INCLUDE="${WX_PREFIX}/lib/include" -DWT_CONFIG_H="${WX_PREFIX}/include" -DBUILD_WEB=ON -DBUILD_GUI=ON
elif [[ "$OSTYPE" == "msys" ]]; then
cmake . --fresh -DBUILD_STATIC=OFF -DWT_INCLUDE="$dir/ext/wt-4.10.0/src" -DWT_CONFIG_H="$dir/ext/wt-4.10.0/build" \
-DBUILD_WEB=ON -DBUILD_GUI=ON
fi
sleep 3
cmake --build .
echo `pwd`
mkdir -p web
pushd web
export LD_LIBRARY_PATH="$SCRIPTPATH/ext/boost_1_82_0/stage/lib":$LD_LIBRARY_PATH
if [[ "$OSTYPE" == "msys"* ]]; then
./Debug/vostro --http-address=0.0.0.0 --http-port=8080 --docroot=.
else
if [[ $RUN -gt 0 ]]; then
$SCRIPTPATH/web/gnostr-web \
--deploy-path=/web \
--http-address=0.0.0.0 \
--http-port=$PORT \
--docroot=. || echo "port busy?"
fi
fi
exit