-
Notifications
You must be signed in to change notification settings - Fork 95
/
install
executable file
·34 lines (30 loc) · 981 Bytes
/
install
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
#!/bin/bash
name=$(uname -s)
arch=$(uname -m)
# replace it with your specific distro
tgtpath="/usr"
#tgtpath="/usr/local"
echo "Installing $name $arch"
include="Tilengine.h"
if [ "$name" == "Linux" ]; then
library="libTilengine.so"
incpath="$tgtpath/include"
libpath="$tgtpath/lib"
srcpath="linux_$arch"
elif [ "$name" == "Darwin" ]; then
library="Tilengine.dylib"
incpath="/usr/local/include"
srcpath="darwin_x86_64"
libpath="/usr/local/lib"
mkdir -p $incpath
mkdir -p $libpath
fi
cmakepath="$libpath/cmake/Tilengine"
pkgconfigpath="$libpath/pkgconfig"
cp include/$include $incpath
cp lib/$srcpath/$library $libpath
mkdir -p $cmakepath
sed -e "s:<library>:$library:g" -e "s:<incpath>:$incpath:g" -e "s:<libpath>:$libpath:g" tilengine-config.cmake > $cmakepath/tilengine-config.cmake
mkdir -p $pkgconfigpath
sed -e "s:<library>:$library:g" -e "s:<incpath>:$incpath:g" -e "s:<libpath>:$libpath:g" tilengine.pc > $pkgconfigpath/tilengine.pc
chmod a+x $libpath/$library