forked from megamarc/Tilengine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·40 lines (36 loc) · 1.1 KB
/
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
35
36
37
38
39
40
#!/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"
if [ $arch == "i686" ]; then
srcpath="linux_i686"
elif [ $arch == "x86_64" ]; then
srcpath="linux_x86_64"
elif [ $arch == "armv7l" ]; then
srcpath="linux_arm"
fi
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