Skip to content

Commit

Permalink
Directory structure refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dorodnic committed Jul 4, 2017
1 parent d1b0c1c commit 10805b8
Show file tree
Hide file tree
Showing 263 changed files with 898 additions and 2,457 deletions.
29 changes: 18 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ set(REALSENSE_CPP
src/win/win-hid.cpp
src/win/win-backend.cpp

third_party/easyloggingpp/src/easylogging++.cc
third-party/easyloggingpp/src/easylogging++.cc

third_party/sqlite/sqlite3.c
third-party/sqlite/sqlite3.c
src/mock/sql.cpp
src/mock/recorder.cpp

Expand Down Expand Up @@ -179,8 +179,8 @@ set(REALSENSE_HPP
src/win/win-hid.h
src/win/win-backend.h

third_party/easyloggingpp/src/easylogging++.h
third_party/sqlite/sqlite3.h
third-party/easyloggingpp/src/easylogging++.h
third-party/sqlite/sqlite3.h
src/mock/sql.h
src/mock/recorder.h
)
Expand Down Expand Up @@ -223,7 +223,7 @@ if(WIN32)
)

source_group("Header Files\\Recorder" FILES
third_party/sqlite/sqlite3.h
third-party/sqlite/sqlite3.h
src/mock/sql.h
src/mock/recorder.h
)
Expand All @@ -233,7 +233,7 @@ if(WIN32)
)

source_group("Source Files\\Recorder" FILES
third_party/sqlite/sqlite3.c
third-party/sqlite/sqlite3.c
src/mock/sql.cpp
src/mock/recorder.cpp
)
Expand Down Expand Up @@ -277,7 +277,7 @@ if(WIN32)
)

source_group("Header Files\\Logging" FILES
third_party/easyloggingpp/src/easylogging++.h
third-party/easyloggingpp/src/easylogging++.h
)

foreach(flag_var
Expand Down Expand Up @@ -363,7 +363,6 @@ if(HWM_OVER_XU)
add_definitions(-DHWM_OVER_XU)
endif()


option(BUILD_SHARED_LIBS "Build shared library" ON)
if(BUILD_SHARED_LIBS)
add_library(realsense2 SHARED ${REALSENSE_CPP} ${REALSENSE_HPP} ${REALSENSE_DEF})
Expand Down Expand Up @@ -425,16 +424,22 @@ else()
endif()

option(BUILD_UNIT_TESTS "Build realsense unit tests." ON)
option(BUILD_EXAMPLES "Build realsense examples." OFF)
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_RS400_EXTRAS "Build RS400 advanced APIs." ON)
option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF)

# This parameter is meant for disabling graphical examples when building for
# headless targets.
option(BUILD_GRAPHICAL_EXAMPLES "Build graphical examples and tools." ON)

if(((BUILD_EXAMPLES AND BUILD_GRAPHICAL_EXAMPLES) OR BUILD_RS400_EXTRAS) AND WIN32)
add_subdirectory(examples/third_party/glfw)
add_subdirectory(examples/third_party/glfw)
endif()

if(BUILD_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(tools)
endif()

if(BUILD_UNIT_TESTS)
Expand All @@ -449,7 +454,9 @@ if (ENFORCE_METADATA)
add_definitions(-DENFORCE_METADATA)
endif()

add_subdirectory(bindings)
if (BUILD_PYTHON_BINDINGS)
add_subdirectory(bindings/python)
endif()

# Check for unreferenced files
FILE(GLOB_RECURSE AllSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
Expand Down
22 changes: 1 addition & 21 deletions bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,6 @@ endif()

set(DEPENDENCIES realsense2)

option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF)

if(BUILD_PYTHON_BINDINGS)
add_subdirectory(third_party/pybind11)
endif()

if(BUILD_PYTHON_BINDINGS)
pybind11_add_module(pyrealsense2 python.cpp)
target_link_libraries(pyrealsense2 ${DEPENDENCIES})
set_target_properties(pyrealsense2 PROPERTIES FOLDER Bindings)
endif()

if(BUILD_PYTHON_BINDINGS)
set(RAW_RS_CPP ../src/backend.cpp ../src/win/win-helpers.cpp ../src/win/win-uvc.cpp pybackend_extras.cpp pybackend.cpp
../src/win/win-usb.cpp ../src/win/win-backend.cpp ../src/linux/backend-v4l2.cpp ../src/linux/backend-hid.cpp ../src/types.cpp
../src/win/win-hid.cpp ../src/archive.cpp ../src/log.cpp ../src/types.cpp ../third_party/easyloggingpp/src/easylogging++.cc)
set(RAW_RS_HPP ../src/backend.h ../src/win/win-helpers.h ../src/win/win-uvc.h ../src/linux/backend-v4l2.h ../src/linux/backend-hid.h
../src/win/win-usb.h ../src/win/win-hid.h ../src/win/win-backend.h ../src/archive.h pybackend_extras.h
../src/types.h ../third_party/easyloggingpp/src/easylogging++.h)
pybind11_add_module(pybackend2 ${RAW_RS_CPP} ${RAW_RS_HPP})
target_link_libraries(pybackend2 ${LIBUSB1_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
set_target_properties(pybackend2 PROPERTIES FOLDER Bindings)
add_subdirectory(python)
endif()
42 changes: 42 additions & 0 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# ubuntu 12.04 LTS cmake version 2.8.7
# ubuntu 14.04 LTS cmake version 2.8.12.2
# ubuntu 16.04 LTS cmake version 3.5.1
cmake_minimum_required(VERSION 2.8.3)

project(RealsensePythonBindings)

# Save the command line compile commands in the build output
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# View the makefile commands during build
#set(CMAKE_VERBOSE_MAKEFILE on)

include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()

set(DEPENDENCIES realsense2)


add_subdirectory(third_party/pybind11)

pybind11_add_module(pyrealsense2 python.cpp)
target_link_libraries(pyrealsense2 ${DEPENDENCIES})
set_target_properties(pyrealsense2 PROPERTIES FOLDER Bindings)

set(RAW_RS_CPP ../../src/backend.cpp ../../src/win/win-helpers.cpp ../../src/win/win-uvc.cpp pybackend_extras.cpp pybackend.cpp
../../src/win/win-usb.cpp ../../src/win/win-backend.cpp ../../src/linux/backend-v4l2.cpp ../../src/linux/backend-hid.cpp ../../src/types.cpp
../../src/win/win-hid.cpp ../../src/archive.cpp ../../src/log.cpp ../../src/types.cpp ../../third-party/easyloggingpp/src/easylogging++.cc)
set(RAW_RS_HPP ../../src/backend.h ../../src/win/win-helpers.h ../../src/win/win-uvc.h ../../src/linux/backend-v4l2.h ../../src/linux/backend-hid.h
../../src/win/win-usb.h ../../src/win/win-hid.h ../../src/win/win-backend.h ../../src/archive.h pybackend_extras.h
../../src/types.h ../../third-party/easyloggingpp/src/easylogging++.h)
pybind11_add_module(pybackend2 ${RAW_RS_CPP} ${RAW_RS_HPP})
target_link_libraries(pybackend2 ${LIBUSB1_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
set_target_properties(pybackend2 PROPERTIES FOLDER Bindings)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions bindings/python/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Readme (TODO)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions bindings/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Readme (TODO)
2 changes: 1 addition & 1 deletion examples/example.hpp → common/example.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ namespace rs2
// Simple font loading code //
//////////////////////////////

#include "third_party/stb_easy_font.h"
#include "../third-party/stb_easy_font.h"

inline void draw_text(int x, int y, const char * text)
{
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/parser.hpp → common/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <functional>
#include <cstring>

#include "third_party/rapidxml/rapidxml.hpp"
#include "rapidxml/rapidxml.hpp"
#include "../src/hw-monitor.h"

#define MAX_PARAMS 4
Expand Down
Binary file removed doc/ds5-placeholder.png
Binary file not shown.
Loading

0 comments on commit 10805b8

Please sign in to comment.