Skip to content

Commit 2e06f8f

Browse files
authored
Merge pull request #391 from thp/cv3-fixed
OpenCV 3 and build system updates
2 parents da0258f + 777aa3a commit 2e06f8f

File tree

14 files changed

+21
-21
lines changed

14 files changed

+21
-21
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
matrix:
22
include:
33
- os: linux
4-
dist: trusty
4+
dist: bionic
55
sudo: required
66
language: cpp
77
compiler: clang
88
env: BUILD_TYPE=linux-native-clang
99
- os: linux
10-
dist: trusty
10+
dist: bionic
1111
sudo: required
1212
language: cpp
1313
compiler: gcc
1414
env: BUILD_TYPE=linux-cross-mingw64
1515
- os: linux
16-
dist: trusty
16+
dist: bionic
1717
sudo: required
1818
language: cpp
1919
compiler: gcc

examples/CMakeLists.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,8 @@ if(PSMOVE_BUILD_EXAMPLES)
2929
set(GLFW_BUILD_TESTS OFF CACHE BOOL "")
3030
add_subdirectory(${ROOT_DIR}/external/glfw EXCLUDE_FROM_ALL)
3131

32-
# C examples
33-
foreach(EXAMPLE distance_calibration)
34-
add_executable(${EXAMPLE} ${CMAKE_CURRENT_LIST_DIR}/c/${EXAMPLE}.c)
35-
target_link_libraries(${EXAMPLE} psmoveapi psmoveapi_tracker)
36-
set_property(TARGET ${EXAMPLE} PROPERTY FOLDER "Utilities")
37-
endforeach()
38-
3932
# C++ examples
40-
foreach(EXAMPLE tracker_camera_calibration)
33+
foreach(EXAMPLE tracker_camera_calibration distance_calibration)
4134
add_executable(${EXAMPLE} ${CMAKE_CURRENT_LIST_DIR}/c/${EXAMPLE}.cpp)
4235
target_link_libraries(${EXAMPLE} psmoveapi psmoveapi_tracker)
4336
set_property(TARGET ${EXAMPLE} PROPERTY FOLDER "Utilities")
@@ -49,7 +42,7 @@ endif()
4942
if(PSMOVE_BUILD_TESTS)
5043
if(PSMOVE_BUILD_TRACKER)
5144
foreach(TESTNAME tracker )
52-
add_executable(test_${TESTNAME} ${CMAKE_CURRENT_LIST_DIR}/c/test_${TESTNAME}.c)
45+
add_executable(test_${TESTNAME} ${CMAKE_CURRENT_LIST_DIR}/c/test_${TESTNAME}.cpp)
5346
target_link_libraries(test_${TESTNAME} psmoveapi psmoveapi_tracker)
5447
set_property(TARGET test_${TESTNAME} PROPERTY FOLDER "Utilities")
5548
endforeach(TESTNAME)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <time.h>
3333
#include <assert.h>
3434

35+
#include "opencv2/opencv_modules.hpp"
3536
#include "opencv2/core/core_c.h"
3637
#include "opencv2/highgui/highgui_c.h"
3738

scripts/install_dependencies.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ UNAME=$(uname)
77

88
case "$UNAME" in
99
Linux)
10-
sudo add-apt-repository --yes ppa:kubuntu-ppa/backports
11-
sudo add-apt-repository --yes ppa:hlprasu/swig-trusty-backports
1210
sudo apt-get update -qq
1311
sudo apt-get install -q -y mingw-w64 g++-mingw-w64
1412
sudo apt-get install -q -y build-essential cmake \
1513
libudev-dev libbluetooth-dev \
1614
libv4l-dev libopencv-dev \
17-
openjdk-7-jdk ant liblwjgl-java \
15+
openjdk-8-jdk ant liblwjgl-java \
1816
python-dev mono-mcs \
1917
swig3.0 freeglut3-dev \
18+
libxrandr-dev libxinerama-dev libxcursor-dev \
2019
python-sphinx python-pip
2120

2221
# Workaround to get BlueZ 5 on Travis CI (it doesn't yet have Ubuntu 16.04)

scripts/macos/build-macos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fi
4848
if [ ! -d "$OPENCV_INSTALL_DIR" ]; then
4949
cd external
5050
if [ ! -d opencv ]; then
51-
git clone --depth 1 --branch 2.4 git://github.com/opencv/opencv.git
51+
git clone --depth 1 --branch 3.4 git://github.com/opencv/opencv.git
5252
fi
5353
cd opencv
5454

scripts/mingw64/cross-compile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fi
1818
PSMOVEAPI_PLATFORM="$1"
1919
shift
2020

21-
OPENCV_VERSION=2.4
21+
OPENCV_VERSION=3.4.7
2222
PSMOVEAPI_VERSION=$(git describe --tags)
2323

2424
MAKE_ARGS="$@"
@@ -32,6 +32,12 @@ if [ ! -f $TOOLCHAIN ]; then
3232
exit 1
3333
fi
3434

35+
# Set POSIX Threads for MinGW (https://stackoverflow.com/a/53528371)
36+
sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
37+
sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
38+
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
39+
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
40+
3541
# Build OpenCV
3642
if [ ! -d external/opencv ]; then
3743
if [ ! -f ${OPENCV_VERSION}.zip ]; then

scripts/visualc/build_msvc.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ IF !ERRORLEVEL! NEQ 0 (
5656
REM Clone OpenCV
5757
IF NOT EXIST %OPENCV_DIR% (
5858
cd %PSMOVE_API_EXTERNAL_DIR%
59-
git clone --depth 1 --branch 2.4 git://github.com/opencv/opencv.git
59+
git clone --depth 1 --branch 3.4 git://github.com/opencv/opencv.git
6060
) ELSE (
6161
echo.
6262
echo OpenCV dir already exists; assuming it has been cloned already

src/tracker/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ENDIF()
2828

2929
# 1 - OpenCV
3030
IF(PSMOVE_BUILD_TRACKER)
31-
FIND_PACKAGE(OpenCV 2 QUIET)
31+
FIND_PACKAGE(OpenCV 3 QUIET)
3232
IF(OpenCV_FOUND)
3333
IF ("${OpenCV_LIBS}" STREQUAL "")
3434
message("OpenCV Libs was empty! Manually setting.")
@@ -71,7 +71,7 @@ IF(PSMOVE_BUILD_TRACKER)
7171
${AVFOUNDATION})
7272
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
7373
list(APPEND PSMOVEAPI_TRACKER_PLATFORM_SRC
74-
${CMAKE_CURRENT_LIST_DIR}/platform/camera_control_win32.c)
74+
${CMAKE_CURRENT_LIST_DIR}/platform/camera_control_win32.cpp)
7575
list(APPEND PSMOVEAPI_TRACKER_REQUIRED_LIBS vfw32 comctl32)
7676
#OpenCV extra dependencies: comctl32 gdi32 ole32 setupapi ws2_32 vfw32
7777
IF(MINGW)

0 commit comments

Comments
 (0)