Skip to content

Commit fcfff30

Browse files
committed
split dependency installation scripts, use official glfw3 .deb packages
1 parent 690a789 commit fcfff30

File tree

7 files changed

+45
-24
lines changed

7 files changed

+45
-24
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ examples/protonect/build
77

88
# Dependency folders
99
depends/*/
10+
depends/*.deb
1011

1112
## Ignore Visual Studio temporary files, build results, and
1213
## files generated by popular Visual Studio add-ons.

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,11 @@ git clone https://github.com/OpenKinect/libfreenect2.git
131131
1. Install a bunch of dependencies
132132

133133
```
134-
sudo apt-get install -y build-essential libturbojpeg libtool autoconf libudev-dev cmake mesa-common-dev freeglut3-dev libxrandr-dev doxygen libxi-dev libopencv-dev automake
134+
sudo apt-get install build-essential libjpeg-turbo8-dev libtool autoconf libudev-dev cmake mesa-common-dev freeglut3-dev libxrandr-dev doxygen libxi-dev libopencv-dev automake
135135
136136
cd libfreenect2/depends
137137
sh install_ubuntu.sh
138-
```
139-
140-
1. Fix libturbojpeg if needed:
141-
142-
```
143-
sudo ln -s /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0.0.0 /usr/lib/x86_64-linux-gnu/libturbojpeg.so
138+
sudo dpkg -i libglfw3*_3.0.4-1_*.deb
144139
```
145140

146141
1. Build the actual protonect executable

depends/install_glfw.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
set -e
3+
4+
cd `dirname $0`
5+
DEPENDS_DIR=`pwd`
6+
7+
# glfw
8+
GLFW_SOURCE_DIR=$DEPENDS_DIR/glfw_src
9+
GLFW_INSTALL_DIR=$DEPENDS_DIR/glfw
10+
11+
rm -rf $GLFW_SOURCE_DIR $GLFW_INSTALL_DIR
12+
13+
git clone https://github.com/glfw/glfw.git $GLFW_SOURCE_DIR
14+
cd $GLFW_SOURCE_DIR
15+
git checkout 3.0.4
16+
mkdir build
17+
cd build
18+
cmake -DCMAKE_INSTALL_PREFIX=$GLFW_INSTALL_DIR -DBUILD_SHARED_LIBS=TRUE ..
19+
make && make install
20+
21+
cd $DEPENDS_DIR
Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,3 @@ make && make install
2020

2121
cd $DEPENDS_DIR
2222

23-
# glfw
24-
GLFW_SOURCE_DIR=$DEPENDS_DIR/glfw_src
25-
GLFW_INSTALL_DIR=$DEPENDS_DIR/glfw
26-
27-
rm -rf $GLFW_SOURCE_DIR $GLFW_INSTALL_DIR
28-
29-
git clone https://github.com/glfw/glfw.git $GLFW_SOURCE_DIR
30-
cd $GLFW_SOURCE_DIR
31-
git checkout 3.0.4
32-
mkdir build
33-
cd build
34-
cmake -DCMAKE_INSTALL_PREFIX=$GLFW_INSTALL_DIR -DBUILD_SHARED_LIBS=TRUE ..
35-
make && make install
36-
37-
cd $DEPENDS_DIR

depends/install_mac.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
cd `dirname $0`
44
DEPENDS_DIR=`pwd`
55

6-
sh ./install_deps.sh
6+
sh ./install_libusb.sh
7+
sh ./install_glfw.sh
78

89
#get the missing cl.hpp from Khronos.org
910
cd /System/Library/Frameworks/OpenCL.framework/Versions/A/Headers/

depends/install_ubuntu.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,21 @@
33
cd `dirname $0`
44
DEPENDS_DIR=`pwd`
55

6-
sh ./install_deps.sh
6+
ARCH="$(uname -m | grep -q 64 && echo 'amd64' || echo 'i386')"
7+
8+
# download standalone packages for 14.04 LTS
9+
wget -N http://archive.ubuntu.com/ubuntu/pool/universe/g/glfw3/libglfw3_3.0.4-1_${ARCH}.deb
10+
wget -N http://archive.ubuntu.com/ubuntu/pool/universe/g/glfw3/libglfw3-dev_3.0.4-1_${ARCH}.deb
11+
wget -N http://archive.ubuntu.com/ubuntu/pool/universe/g/glfw3/libglfw3-doc_3.0.4-1_all.deb
12+
13+
sh ./install_libusb.sh
14+
15+
cat <<-EOT
16+
17+
Execute the following commands to install the remaining dependencies (if you have not already done so):
18+
19+
sudo dpkg -i libglfw3*_3.0.4-1_*.deb
20+
sudo apt-get install build-essential libjpeg-turbo8-dev libtool autoconf libudev-dev cmake mesa-common-dev freeglut3-dev libxrandr-dev doxygen libxi-dev libopencv-dev automake
21+
22+
EOT
23+

examples/protonect/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ PROJECT(libfreenect2)
1414
SET(CMAKE_BUILD_TYPE RelWithDebInfo)
1515

1616
SET(MY_DIR ${libfreenect2_SOURCE_DIR})
17+
SET(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${MY_DIR}../../depends/libusb/lib/:${MY_DIR}../../depends/glfw/lib/" )
1718

1819
OPTION(ENABLE_CXX11 "Enable C++11 support" OFF)
1920
OPTION(ENABLE_OPENCL "Enable OpenCL support" ON)

0 commit comments

Comments
 (0)