Skip to content

Commit

Permalink
Merge pull request #2 from IntelRealSense/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
zivsha authored Sep 11, 2017
2 parents 126fc8e + 4458d68 commit c4f99a7
Show file tree
Hide file tree
Showing 198 changed files with 27,938 additions and 6,829 deletions.
75 changes: 48 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,60 @@ sudo: required
dist: xenial

before_install:
# Install nodejs via nvm
- wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
- source ~/.bashrc
- nvm install 6 && nvm use 6
- npm install -g node-gyp

# Remove duplicated python 2.x, otherwise node-gyp will complain and stop
- pyenv uninstall -f 2.7.13

# Run linter
- git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
- export OLDPATH=$PATH && export PATH=$PATH:$(pwd)/depot_tools;
- cd wrappers/nodejs/tools && npm install && cd ..
- node ./tools/linter.js
- export PATH=$OLDPATH && unset OLDPATH && cd ../../

# Get logical CPU number
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export CPU_NUM=`grep -c ^processor /proc/cpuinfo`;
elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
export CPU_NUM=`sysctl -n hw.logicalcpu_max`;
fi

# Install linux required packages
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test;
wget https://github.com/glfw/glfw/releases/download/3.1.1/glfw-3.1.1.zip;
sudo apt-get update;
sudo apt-get-repository ppa:ubuntu-toolchain-r/test;
sudo apt-get update;
sudo apt-get install -qq build-essential xorg-dev libglu1-mesa-dev libglew-dev libglm-dev;
sudo apt-get install -qq libusb-1.0-0-dev;
sudo apt-get install -qq libgtk-3-dev;
sudo apt-get install -qq python python-dev;
sudo apt-get install gcc-5 g++-5;
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5;
fi

install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get install -qq build-essential xorg-dev libglu1-mesa-dev libglew-dev libglm-dev;
sudo apt-get install -qq cmake;
sudo apt-get install -qq libusb-1.0-0-dev ;
sudo apt-get install -qq libgtk-3-dev ;
sudo apt-get install python python-dev ;

cmake --version;

unzip glfw-3.1.1.zip;
cd glfw-3.1.1;
sudo cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON;
sudo make;
sudo make install;
cd ..;
fi
# Install nodejs via nvm
- wget https://github.com/glfw/glfw/releases/download/3.1.1/glfw-3.1.1.zip
- unzip glfw-3.1.1.zip && cd glfw-3.1.1
- cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON
- make -j $CPU_NUM
- sudo make install && cd ..

script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
uname -a;
mkdir build;
cd build;
cmake .. -DBUILD_EXAMPLES:BOOL=true -DBUILD_PYTHON_BINDINGS=bool:true;
make;
sudo make install;
fi
# Exit immediately if a command exits with a non-zero status
- set -e
# Build librealsense
- pyenv local 3.6.1
- mkdir build && cd build
- cmake .. -DBUILD_EXAMPLES:BOOL=true -DBUILD_PYTHON_BINDINGS:BOOL=true -DBUILD_NODEJS_BINDINGS:BOOL=true
- make -j $CPU_NUM
- sudo "PATH=$PATH" make install

# Run test
- export LRS_LOG_LEVEL="DEBUG"
- wget http://realsense-hw-public.s3.amazonaws.com/rs-tests/awgc4
- ./unit-tests/live-test from awgc4 -d yes
18 changes: 15 additions & 3 deletions CMake/realsense.def
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ EXPORTS
rs2_get_video_stream_intrinsics

rs2_get_stream_profile_size
rs2_is_stream_profile_recommended
rs2_is_stream_profile_default

rs2_delete_stream_profile
rs2_clone_stream_profile
Expand Down Expand Up @@ -187,7 +187,7 @@ EXPORTS
rs2_context_add_device
rs2_context_remove_device

rs2_playback_device_get_file_path
rs2_playback_device_get_file_path
rs2_playback_get_duration
rs2_playback_seek
rs2_playback_get_position
Expand All @@ -197,11 +197,14 @@ EXPORTS
rs2_playback_device_is_real_time
rs2_playback_device_set_status_changed_callback
rs2_playback_device_get_current_status
rs2_playback_device_set_playback_speed
rs2_playback_device_set_playback_speed
rs2_playback_device_stop

rs2_create_align
rs2_create_pipeline
rs2_create_pipeline_with_device
rs2_pipeline_get_device
rs2_pipeline_get_context
rs2_start_pipeline_with_callback
rs2_start_pipeline_with_callback_cpp
rs2_start_pipeline
Expand All @@ -211,4 +214,13 @@ EXPORTS
rs2_disable_all_streams_pipeline
rs2_pipeline_wait_for_frames
rs2_pipeline_poll_for_frames
rs2_pipeline_get_extrinsics
rs2_pipeline_get_selection
rs2_pipeline_get_stream_type_selection
rs2_can_enable_stream_pipeline
rs2_delete_pipeline

rs2_create_device_hub
rs2_device_hub_is_device_connected
rs2_device_hub_wait_for_device
rs2_delete_device_hub
54 changes: 32 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,10 @@ set(REALSENSE_HPP
include/librealsense2/hpp/rs_pipeline.hpp

include/librealsense2/rsutil.h
include/librealsense2/rsutil.hpp
include/librealsense2/rs_advanced_mode.h
include/librealsense2/rs_advanced_mode.hpp
include/librealsense2/h/rs_advanced_mode_command.h

src/res/resource.h

src/core/streaming.h
Expand Down Expand Up @@ -309,11 +308,13 @@ if(WIN32)
include/librealsense2/rs.h
CMake/realsense.def
)
source_group("Header Files\\API\\C Headers" FILES

source_group("Header Files\\API\\C Headers" FILES
include/librealsense2/h/rs_context.h
include/librealsense2/h/rs_device.h
include/librealsense2/h/rs_frame.h
include/librealsense2/h/rs_types.h
include/librealsense2/h/rs_sensor.h
include/librealsense2/h/rs_option.h
include/librealsense2/h/rs_processing.h
include/librealsense2/h/rs_record_playback.h
Expand All @@ -325,15 +326,18 @@ if(WIN32)
include/librealsense2/rs_advanced_mode.h
include/librealsense2/h/rs_advanced_mode_command.h
)

source_group("Header Files\\API\\C++ Headers" FILES

source_group("Header Files\\API\\C++ Headers" FILES
include/librealsense2/hpp/rs_types.hpp
include/librealsense2/hpp/rs_context.hpp
include/librealsense2/hpp/rs_device.hpp
include/librealsense2/hpp/rs_frame.hpp
include/librealsense2/hpp/rs_processing.hpp
include/librealsense2/hpp/rs_pipeline.hpp
include/librealsense2/hpp/rs_record_playback.hpp
include/librealsense2/hpp/rs_sensor.hpp
include/librealsense2/hpp/rs_streaming.hpp
include/librealsense2/hpp/rs_internal.hpp
include/librealsense2/hpp/rs_pipeline.hpp

include/librealsense2/rsutil.hpp
include/librealsense2/rs_advanced_mode.hpp
)

Expand All @@ -342,10 +346,11 @@ if(WIN32)
src/mock/sql.h
src/mock/recorder.h
)
source_group("Source Files\\Recorder" FILES

source_group("Source Files\\Recorder" FILES
third-party/sqlite/sqlite3.c
src/mock/sql.cpp
src/mock/sql.cpp
src/mock/recorder.cpp
)

source_group("Source Files\\API" FILES
Expand Down Expand Up @@ -517,16 +522,16 @@ add_subdirectory(third-party/realsense-file)

option(BUILD_SHARED_LIBS "Build shared library" ON)
if(BUILD_SHARED_LIBS)
if(WIN32)
add_library(realsense2 SHARED
${REALSENSE_CPP} ${REALSENSE_HPP} ${REALSENSE_DEF}
src/res/resource.h
if(WIN32)
add_library(realsense2 SHARED
${REALSENSE_CPP} ${REALSENSE_HPP} ${REALSENSE_DEF}
src/res/resource.h
src/res/librealsense.rc)
source_group("Resources" FILES
src/res/resource.h
src/res/librealsense.rc
)

source_group("Resources" FILES
src/res/resource.h
src/res/librealsense.rc
)
else()
add_library(realsense2 SHARED ${REALSENSE_CPP} ${REALSENSE_HPP} ${REALSENSE_DEF})
endif()
Expand Down Expand Up @@ -587,10 +592,11 @@ else()
install(CODE "execute_process(COMMAND ldconfig)")
endif()

option(BUILD_UNIT_TESTS "Build realsense unit tests." ON)
option(BUILD_UNIT_TESTS "Build realsense unit tests." ON)
option(BUILD_EXAMPLES "Build realsense examples and tools." ON)
option(ENFORCE_METADATA "Require WinSDK with Metadata support during compilation. Windows OS Only" OFF)
option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF)
option(BUILD_NODEJS_BINDINGS "Build Node.js bindings" OFF)

# This parameter is meant for disabling graphical examples when building for
# save-to-disk targets.
Expand All @@ -617,6 +623,10 @@ if (BUILD_PYTHON_BINDINGS)
add_subdirectory(wrappers/python)
endif()

if (BUILD_NODEJS_BINDINGS)
add_subdirectory(wrappers/nodejs)
endif()

# Check for unreferenced files
FILE(GLOB_RECURSE AllSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"src/*.c" "src/*.cpp" "src/*.cc" "src/*.c++"
Expand Down
52 changes: 45 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,52 @@
# appveyor file
# http://www.appveyor.com/docs/appveyor-yml
# Copyright (c) 2017 Intel Corporation. All rights reserved.
# Use of this source code is governed by a Apache License
# Version 2.0 license that can be found in the LICENSE file.
version: 2.1.{build}
branches:
only:
- development
skip_tags: true
environment:
nodejs_version: "6"
image: Visual Studio 2015
clone_folder: c:\projects\librealsense
init:
- cmd:
install:
- ps: Install-Product node $env:nodejs_version
- cmd: >-
cd c:\projects\librealsense\.. && git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
os: Visual Studio 2013
set OLDPATH=%PATH% && set PATH=%PATH%;c:\projects\depot_tools
cd c:\projects\librealsense\wrappers\nodejs\tools && npm install
cd c:\projects\librealsense\wrappers\nodejs && node .\tools\linter.js && set PATH=%OLDPATH% && set OLDPATH=
before_build:
- cmd: nuget restore librealsense.vc12/realsense.sln -Verbosity detailed
- cmd: >-
cd c:\projects\librealsense && mkdir build && cd build
cmake .. -DBUILD_EXAMPLES=true -DBUILD_PYTHON_BINDINGS=true -DBUILD_NODEJS_BINDINGS:BOOL=true
build:
project: ./build/Realsense.sln
verbosity: minimal
project: librealsense.vc12/realsense.sln
test_script:
- ps: >-
$url = "http://realsense-hw-public.s3.amazonaws.com/rs-tests/awgc4"
$output = "C:/projects/librealsense/build/Debug/awgc4"
Invoke-WebRequest -Uri $url -OutFile $output
& cmd.exe /c C:/projects/librealsense/build/Debug/live-test.exe from C:/projects/librealsense/build/Debug/awgc4 -d yes
if ($LASTEXITCODE -ne 0)
{
throw "Tests failed!"
}
cache:
- librealsense.vc12/packages
# TODO(halton): Add unit test for Node.js binding
Loading

0 comments on commit c4f99a7

Please sign in to comment.