Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utilities as a library #11137

Merged
merged 11 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMake/opengl_config.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
find_package(OpenGL REQUIRED)
set(DEPENDENCIES realsense2 glfw ${OPENGL_LIBRARIES})
set(DEPENDENCIES realsense2 utilities glfw ${OPENGL_LIBRARIES})
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ include(src/CMakeLists.txt)
include(third-party/CMakeLists.txt)
include(common/utilities/CMakeLists.txt)

target_link_libraries( ${LRS_TARGET} PRIVATE utilities )

# configure the project according to OS specific requirments
# macro definition located at "CMake/<OS>_config.cmake"
os_target_config()
Expand Down
2 changes: 1 addition & 1 deletion common/metadata-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <memory>

#include <librealsense2/rs.hpp>
#include <librealsense2/utilities/string/windows.h>
#include <utilities/string/windows.h>

#define MAX_KEY_LENGTH 255
#define MAX_VALUE_NAME 16383
Expand Down
4 changes: 2 additions & 2 deletions common/model-views.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include "fw-update-helper.h"
#include "updates-model.h"
#include "calibration-model.h"
#include <librealsense2/utilities/time/periodic-timer.h>
#include <librealsense2/utilities/number/stabilized-value.h>
#include <utilities/time/periodic-timer.h>
#include <utilities/number/stabilized-value.h>
#include "reflectivity/reflectivity.h"

ImVec4 from_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a, bool consistent_color = false);
Expand Down
2 changes: 1 addition & 1 deletion common/on-chip-calib.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include "notifications.h"
#include <librealsense2/utilities/concurrency/concurrency.h>
#include <utilities/concurrency/concurrency.h>
#include "../src/algo.h"

#include <random>
Expand Down
4 changes: 2 additions & 2 deletions common/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <wchar.h>
#include <KnownFolders.h>
#include <shlobj.h>
#include <librealsense2/utilities/os/hresult.h>
#include <utilities/os/hresult.h>
#endif

#if (defined(_WIN32) || defined(_WIN64))
Expand Down Expand Up @@ -417,4 +417,4 @@ Some auxillary functionalities might be affected. Please report this message if

return escaped.str();
}
}
}
2 changes: 1 addition & 1 deletion common/output-model.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <GLFW/glfw3.h>
#include <imgui.h>

#include <librealsense2/utilities/concurrency/concurrency.h>
#include <utilities/concurrency/concurrency.h>

namespace rs2
{
Expand Down
2 changes: 1 addition & 1 deletion common/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#endif

#include "../third-party/rapidxml/rapidxml.hpp"
#include <librealsense2/utilities/string/string-utilities.h>
#include <utilities/string/string-utilities.h>

#define MAX_PARAMS 4

Expand Down
2 changes: 1 addition & 1 deletion common/realsense-ui-advanced-mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <librealsense2/rs_advanced_mode.hpp>
#include <types.h>
#include <type_traits>
#include <librealsense2/utilities/string/string-utilities.h>
#include <utilities/string/string-utilities.h>

#define TEXT_BUFF_SIZE 1024

Expand Down
2 changes: 1 addition & 1 deletion common/rendering.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <librealsense2/rs.hpp>
#include <librealsense2-gl/rs_processing_gl.hpp>
#include <librealsense2/utilities/time/timer.h>
#include <utilities/time/stopwatch.h>

#include "matrix4.h"
#include "float3.h"
Expand Down
2 changes: 1 addition & 1 deletion common/utilities/imgui/wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <vector>
#include <sstream>
#include "wrap.h"
#include <librealsense2/utilities/string/split.h>
#include <utilities/string/split.h>
#include "../third-party/imgui/imgui.h"

namespace utilities {
Expand Down
2 changes: 1 addition & 1 deletion common/utilities/time/l500/get-mfr-ww.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include <string>
#include <librealsense2/utilities/time/work-week.h>
#include <utilities/time/work-week.h>


namespace utilities {
Expand Down
2 changes: 1 addition & 1 deletion common/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#define ARCBALL_CAMERA_IMPLEMENTATION
#include <arcball_camera.h>
#include <librealsense2/utilities/string/trim-newlines.h>
#include <utilities/string/trim-newlines.h>
#include "../common/utilities/imgui/wrap.h"

namespace rs2
Expand Down
2 changes: 1 addition & 1 deletion common/windows-app-bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "os.h"
#include "metadata-helper.h"
#include "rendering.h"
#include <librealsense2/utilities/string/windows.h>
#include <utilities/string/windows.h>

#include <delayimp.h>

Expand Down
3 changes: 1 addition & 2 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ target_sources(${LRS_TARGET}
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/rsutil.h"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/rs_advanced_mode.h"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/rs_advanced_mode.hpp"

)

include(${CMAKE_CURRENT_LIST_DIR}/librealsense2/utilities/CMakeLists.txt)
9 changes: 0 additions & 9 deletions include/librealsense2/utilities/CMakeLists.txt

This file was deleted.

7 changes: 0 additions & 7 deletions include/librealsense2/utilities/concurrency/CMakeLists.txt

This file was deleted.

6 changes: 0 additions & 6 deletions include/librealsense2/utilities/easylogging/CMakeLists.txt

This file was deleted.

10 changes: 0 additions & 10 deletions include/librealsense2/utilities/easylogging/easyloggingpp.cmake

This file was deleted.

6 changes: 0 additions & 6 deletions include/librealsense2/utilities/number/CMakeLists.txt

This file was deleted.

9 changes: 0 additions & 9 deletions include/librealsense2/utilities/os/CMakeLists.txt

This file was deleted.

16 changes: 0 additions & 16 deletions include/librealsense2/utilities/string/CMakeLists.txt

This file was deleted.

12 changes: 0 additions & 12 deletions include/librealsense2/utilities/time/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion include/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
Under `librealsense2` folder you will find two subfolers:
* [h](./librealsense2/h) - Contains headers for the C language
* [hpp](./librealsense2/hpp) - Contains headers for the C++ language, depends on C headers
* [utilities](./librealsense2/utilities) - Contains utility classes/functions for the C/C++ language

In addition, you can include [<librealsense2/rs.h>](./librealsense2/rs.h) and [<librealsense2/rs.hpp>](./librealsense2/rs.hpp) to get most of SDK functionality in C and C++ respectively.

Expand Down
4 changes: 2 additions & 2 deletions scripts/api_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# This script makes sure every API header can be included in isolation

for filename in $(find ../include/librealsense2 -name *.hpp -not -path "../include/librealsense2/utilities/**"); do
for filename in $(find ../include/librealsense2 -name *.hpp); do
echo Checking that $filename is self-contained
rm 1.cpp
echo "#include \"$filename\"" >> 1.cpp
Expand All @@ -12,7 +12,7 @@ for filename in $(find ../include/librealsense2 -name *.hpp -not -path "../inclu
echo
done

for filename in $(find ../include/librealsense2 -name *.h -not -path "../include/librealsense2/utilities/**"); do
for filename in $(find ../include/librealsense2 -name *.h); do
echo Checking that $filename is self-contained
rm 1.c
echo "#include \"$filename\"" >> 1.c
Expand Down
1 change: 0 additions & 1 deletion src/algo.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#pragma once
#include "sensor.h"
#include <librealsense2/utilities/concurrency/concurrency.h>
#include "types.h"

#include <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion src/compression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(realsense2-compression VERSION 1.0.0 LANGUAGES CXX C)
# Save the command line compile commands in the build output
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

set(DEPENDENCIES ${DEPENDENCIES} realsense2)
list( APPEND DEPENDENCIES realsense2 utilities )

file(GLOB COMPRESSION_SOURCES
"*.h"
Expand Down
1 change: 0 additions & 1 deletion src/error-handling.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* Copyright(c) 2019 Intel Corporation. All Rights Reserved. */
#pragma once

#include <librealsense2/utilities/concurrency/concurrency.h>
#include "option.h"
#include "types.h"

Expand Down
2 changes: 1 addition & 1 deletion src/ethernet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ endif()
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)

target_link_libraries(${PROJECT_NAME}
PRIVATE ${WINLIB} realsense2 realsense2-compression
PRIVATE ${WINLIB} realsense2 realsense2-compression utilities
)

set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Library)
Expand Down
7 changes: 4 additions & 3 deletions src/gl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ configure_package_config_file(../../CMake/realsense2-glConfig.cmake.in realsense

configure_file(../../config/librealsense-gl.pc.in ../../config/realsense2-gl.pc @ONLY)

target_link_libraries(${PROJECT_NAME}
PRIVATE ${DEPENDENCIES}
)
target_link_libraries( ${PROJECT_NAME}
PRIVATE
${DEPENDENCIES}
)

# CMake prior to 3.13 cannot install targets located in sub-directories.
#https://gitlab.kitware.com/cmake/cmake/merge_requests/2152
Expand Down
1 change: 0 additions & 1 deletion src/gl/synthetic-stream-gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "tiny-profiler.h" // common/
#include <glad/glad.h>

#include <librealsense2/utilities/concurrency/concurrency.h>
#include <functional>
#include <thread>
#include <deque>
Expand Down
2 changes: 1 addition & 1 deletion src/hid/hid-device.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "hid-types.h"
#include "../usb/usb-messenger.h"
#include "../usb/usb-enumerator.h"
#include <librealsense2/utilities/concurrency/concurrency.h>
#include <utilities/concurrency/concurrency.h>
#include "stdio.h"
#include "stdlib.h"

Expand Down
4 changes: 2 additions & 2 deletions src/ipDeviceCommon/NetdevLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#pragma once

#include <easylogging++.h>
#include <utilities/easylogging/easyloggingpp.h>

#define DBG CLOG(DEBUG, "librealsense")
#define ERR CLOG(ERROR, "librealsense")
#define WRN CLOG(WARNING, "librealsense")
#define INF CLOG(INFO, "librealsense")
#define INF CLOG(INFO, "librealsense")
2 changes: 1 addition & 1 deletion src/ipDeviceCommon/RsUsageEnvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include <BasicUsageEnvironment.hh>
#include <easylogging++.h>
#include <utilities/easylogging/easyloggingpp.h>

#define RS_MAX_LOG_MSG_SIZE 1024
#define RS_MAX_LOG_MSG_THLD 128
Expand Down
4 changes: 2 additions & 2 deletions src/l500/l500-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include "proc/syncer-processing-block.h"
#include "proc/rotation-transform.h"
#include "../common/fw/firmware-version.h"
#include <librealsense2/utilities/time/periodic-timer.h>
#include <librealsense2/utilities/time/work-week.h>
#include <utilities/time/periodic-timer.h>
#include <utilities/time/work-week.h>
#include "../common/utilities/time/l500/get-mfr-ww.h"


Expand Down
2 changes: 1 addition & 1 deletion src/librealsense-exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include <librealsense2/h/rs_types.h>
#include <librealsense2/utilities/easylogging/easyloggingpp.h>
#include <utilities/easylogging/easyloggingpp.h>
#include "basics.h" // LRS_EXTENSION_API

#include <exception>
Expand Down
3 changes: 2 additions & 1 deletion src/libusb/context-libusb.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
#pragma once

#include "usb/usb-types.h"
#include <librealsense2/utilities/concurrency/concurrency.h>

#include <memory>
#include <thread>
#include <mutex>
#include "libusb.h"

namespace librealsense
Expand Down
2 changes: 1 addition & 1 deletion src/linux/udev-device-watcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include "../backend.h"
#include <librealsense2/utilities/concurrency/concurrency.h>
#include <utilities/concurrency/concurrency.h>
#include "../callback-invocation.h"

#include <libudev.h>
Expand Down
1 change: 0 additions & 1 deletion src/media/playback/playback_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "../../core/serialization.h"
#include "../../core/streaming.h"
#include "../../archive.h"
#include <librealsense2/utilities/concurrency/concurrency.h>
#include "../../sensor.h"
#include "playback_sensor.h"

Expand Down
1 change: 0 additions & 1 deletion src/media/playback/playback_sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "../../core/serialization.h"
#include "../../core/streaming.h"
#include "../../archive.h"
#include <librealsense2/utilities/concurrency/concurrency.h>
#include "../../sensor.h"
#include "../../types.h"

Expand Down
Loading