Skip to content

Commit

Permalink
move utilities to librealsense include dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed Apr 6, 2022
1 parent d5b5c6c commit 34d3576
Show file tree
Hide file tree
Showing 94 changed files with 393 additions and 358 deletions.
135 changes: 63 additions & 72 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,71 @@
# Copyright(c) 2019 Intel Corporation. All Rights Reserved.

set(COMMON_SRC
"${CMAKE_CURRENT_LIST_DIR}/animated.h"
"${CMAKE_CURRENT_LIST_DIR}/float2.h"
"${CMAKE_CURRENT_LIST_DIR}/float3.h"
"${CMAKE_CURRENT_LIST_DIR}/float4.h"
"${CMAKE_CURRENT_LIST_DIR}/matrix4.h"
"${CMAKE_CURRENT_LIST_DIR}/rect.h"
"${CMAKE_CURRENT_LIST_DIR}/rendering.h"
"${CMAKE_CURRENT_LIST_DIR}/model-views.h"
"${CMAKE_CURRENT_LIST_DIR}/model-views.cpp"
"${CMAKE_CURRENT_LIST_DIR}/notifications.h"
"${CMAKE_CURRENT_LIST_DIR}/notifications.cpp"
"${CMAKE_CURRENT_LIST_DIR}/calibration-model.h"
"${CMAKE_CURRENT_LIST_DIR}/calibration-model.cpp"
"${CMAKE_CURRENT_LIST_DIR}/viewer.h"
"${CMAKE_CURRENT_LIST_DIR}/viewer.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ux-window.h"
"${CMAKE_CURRENT_LIST_DIR}/ux-window.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ux-alignment.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ux-alignment.h"
"${CMAKE_CURRENT_LIST_DIR}/opengl3.cpp"
"${CMAKE_CURRENT_LIST_DIR}/opengl3.h"
"${CMAKE_CURRENT_LIST_DIR}/rs-config.h"
"${CMAKE_CURRENT_LIST_DIR}/rs-config.cpp"
"${CMAKE_CURRENT_LIST_DIR}/os.h"
"${CMAKE_CURRENT_LIST_DIR}/os.cpp"
"${CMAKE_CURRENT_LIST_DIR}/fw-update-helper.h"
"${CMAKE_CURRENT_LIST_DIR}/fw-update-helper.cpp"
"${CMAKE_CURRENT_LIST_DIR}/metadata-helper.h"
"${CMAKE_CURRENT_LIST_DIR}/metadata-helper.cpp"
"${CMAKE_CURRENT_LIST_DIR}/output-model.h"
"${CMAKE_CURRENT_LIST_DIR}/output-model.cpp"
"${CMAKE_CURRENT_LIST_DIR}/skybox.h"
"${CMAKE_CURRENT_LIST_DIR}/skybox.cpp"
"${CMAKE_CURRENT_LIST_DIR}/measurement.h"
"${CMAKE_CURRENT_LIST_DIR}/measurement.cpp"
"${CMAKE_CURRENT_LIST_DIR}/on-chip-calib.h"
"${CMAKE_CURRENT_LIST_DIR}/on-chip-calib.cpp"
"${CMAKE_CURRENT_LIST_DIR}/decompress-huffman.h"
"${CMAKE_CURRENT_LIST_DIR}/updates-model.h"
"${CMAKE_CURRENT_LIST_DIR}/updates-model.cpp"
)
"${CMAKE_CURRENT_LIST_DIR}/animated.h"
"${CMAKE_CURRENT_LIST_DIR}/float2.h"
"${CMAKE_CURRENT_LIST_DIR}/float3.h"
"${CMAKE_CURRENT_LIST_DIR}/float4.h"
"${CMAKE_CURRENT_LIST_DIR}/matrix4.h"
"${CMAKE_CURRENT_LIST_DIR}/rect.h"
"${CMAKE_CURRENT_LIST_DIR}/rendering.h"
"${CMAKE_CURRENT_LIST_DIR}/model-views.h"
"${CMAKE_CURRENT_LIST_DIR}/model-views.cpp"
"${CMAKE_CURRENT_LIST_DIR}/notifications.h"
"${CMAKE_CURRENT_LIST_DIR}/notifications.cpp"
"${CMAKE_CURRENT_LIST_DIR}/calibration-model.h"
"${CMAKE_CURRENT_LIST_DIR}/calibration-model.cpp"
"${CMAKE_CURRENT_LIST_DIR}/viewer.h"
"${CMAKE_CURRENT_LIST_DIR}/viewer.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ux-window.h"
"${CMAKE_CURRENT_LIST_DIR}/ux-window.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ux-alignment.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ux-alignment.h"
"${CMAKE_CURRENT_LIST_DIR}/opengl3.cpp"
"${CMAKE_CURRENT_LIST_DIR}/opengl3.h"
"${CMAKE_CURRENT_LIST_DIR}/rs-config.h"
"${CMAKE_CURRENT_LIST_DIR}/rs-config.cpp"
"${CMAKE_CURRENT_LIST_DIR}/os.h"
"${CMAKE_CURRENT_LIST_DIR}/os.cpp"
"${CMAKE_CURRENT_LIST_DIR}/fw-update-helper.h"
"${CMAKE_CURRENT_LIST_DIR}/fw-update-helper.cpp"
"${CMAKE_CURRENT_LIST_DIR}/metadata-helper.h"
"${CMAKE_CURRENT_LIST_DIR}/metadata-helper.cpp"
"${CMAKE_CURRENT_LIST_DIR}/output-model.h"
"${CMAKE_CURRENT_LIST_DIR}/output-model.cpp"
"${CMAKE_CURRENT_LIST_DIR}/skybox.h"
"${CMAKE_CURRENT_LIST_DIR}/skybox.cpp"
"${CMAKE_CURRENT_LIST_DIR}/measurement.h"
"${CMAKE_CURRENT_LIST_DIR}/measurement.cpp"
"${CMAKE_CURRENT_LIST_DIR}/on-chip-calib.h"
"${CMAKE_CURRENT_LIST_DIR}/on-chip-calib.cpp"
"${CMAKE_CURRENT_LIST_DIR}/decompress-huffman.h"
"${CMAKE_CURRENT_LIST_DIR}/updates-model.h"
"${CMAKE_CURRENT_LIST_DIR}/updates-model.cpp"
)

set(SW_UPDATE_FILES
"${CMAKE_CURRENT_LIST_DIR}/sw-update/http-downloader.h"
"${CMAKE_CURRENT_LIST_DIR}/sw-update/http-downloader.cpp"
"${CMAKE_CURRENT_LIST_DIR}/sw-update/dev-updates-profile.h"
"${CMAKE_CURRENT_LIST_DIR}/sw-update/dev-updates-profile.cpp"
"${CMAKE_CURRENT_LIST_DIR}/sw-update/versions-db-manager.h"
"${CMAKE_CURRENT_LIST_DIR}/sw-update/versions-db-manager.cpp"
)
set(SW_UPDATE_FILES
"${CMAKE_CURRENT_LIST_DIR}/sw-update/http-downloader.h"
"${CMAKE_CURRENT_LIST_DIR}/sw-update/http-downloader.cpp"
"${CMAKE_CURRENT_LIST_DIR}/sw-update/dev-updates-profile.h"
"${CMAKE_CURRENT_LIST_DIR}/sw-update/dev-updates-profile.cpp"
"${CMAKE_CURRENT_LIST_DIR}/sw-update/versions-db-manager.h"
"${CMAKE_CURRENT_LIST_DIR}/sw-update/versions-db-manager.cpp"
)

set(REFLECTIVITY_FILES
"${CMAKE_CURRENT_LIST_DIR}/reflectivity/reflectivity.h"
"${CMAKE_CURRENT_LIST_DIR}/reflectivity/reflectivity.cpp"
)
set(REFLECTIVITY_FILES
"${CMAKE_CURRENT_LIST_DIR}/reflectivity/reflectivity.h"
"${CMAKE_CURRENT_LIST_DIR}/reflectivity/reflectivity.cpp"
)

set(UTILITIES_FILES
"${CMAKE_CURRENT_LIST_DIR}/utilities/number/stabilized-value.h"
"${CMAKE_CURRENT_LIST_DIR}/utilities/string/split.h"
"${CMAKE_CURRENT_LIST_DIR}/utilities/string/string-utilities.h"
"${CMAKE_CURRENT_LIST_DIR}/utilities/string/trim-newlines.h"
"${CMAKE_CURRENT_LIST_DIR}/utilities/imgui/wrap.h"
"${CMAKE_CURRENT_LIST_DIR}/utilities/imgui/wrap.cpp"
)
if (WIN32)
list(APPEND UTILITIES_FILES
"${CMAKE_CURRENT_LIST_DIR}/utilities/string/windows.h"
)
endif()
set(UTILITIES_FILES
"${CMAKE_CURRENT_LIST_DIR}/utilities/imgui/wrap.h"
"${CMAKE_CURRENT_LIST_DIR}/utilities/imgui/wrap.cpp"
)

set(COMMON_SRC
${COMMON_SRC}
${SW_UPDATE_FILES}
${REFLECTIVITY_FILES}
${UTILITIES_FILES}
)
set(COMMON_SRC
${COMMON_SRC}
${SW_UPDATE_FILES}
${REFLECTIVITY_FILES}
${UTILITIES_FILES}
)

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 "utilities/string/windows.h"
#include <librealsense2/utilities/string/windows.h>

#define MAX_KEY_LENGTH 255
#define MAX_VALUE_NAME 16383
Expand Down
2 changes: 1 addition & 1 deletion common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "metadata-helper.h"
#include "calibration-model.h"
#include "sw-update/http-downloader.h"
#include "utilities/filesystem/glob.h"
#include "filesystem/glob.h"

#include <thread>
#include <algorithm>
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,9 +27,9 @@
#include "fw-update-helper.h"
#include "updates-model.h"
#include "calibration-model.h"
#include <utilities/time/periodic_timer.h>
#include <librealsense2/utilities/time/periodic-timer.h>
#include <librealsense2/utilities/number/stabilized-value.h>
#include "reflectivity/reflectivity.h"
#include <utilities/number/stabilized-value.h>

ImVec4 from_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a, bool consistent_color = false);
ImVec4 operator+(const ImVec4& c, float v);
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 "../src/concurrency.h"
#include <librealsense2/utilities/concurrency/concurrency.h>
#include "../src/algo.h"

#include <random>
Expand Down
2 changes: 1 addition & 1 deletion 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 "utilities/os/hresult.h"
#include <librealsense2/utilities/os/hresult.h>
#endif

#if (defined(_WIN32) || defined(_WIN64))
Expand Down
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 "../src/concurrency.h"
#include <librealsense2/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 "./utilities/string/string-utilities.h"
#include <librealsense2/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 "utilities/string/string-utilities.h"
#include <librealsense2/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 <utilities/time/timer.h>
#include <librealsense2/utilities/time/timer.h>

#include "matrix4.h"
#include "float3.h"
Expand Down
9 changes: 0 additions & 9 deletions common/utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@

target_sources(${LRS_TARGET}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/time/common.h"
"${CMAKE_CURRENT_LIST_DIR}/time/stopwatch.h"
"${CMAKE_CURRENT_LIST_DIR}/time/timer.h"
"${CMAKE_CURRENT_LIST_DIR}/time/periodic_timer.h"
"${CMAKE_CURRENT_LIST_DIR}/time/waiting-on.h"
"${CMAKE_CURRENT_LIST_DIR}/time/work_week.h"
"${CMAKE_CURRENT_LIST_DIR}/time/work_week.cpp"
"${CMAKE_CURRENT_LIST_DIR}/time/l500/get-mfr-ww.h"
"${CMAKE_CURRENT_LIST_DIR}/time/l500/get-mfr-ww.cpp"
)

include(${CMAKE_CURRENT_LIST_DIR}/os/CMakeLists.txt)
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 "../common/utilities/string/split.h"
#include <librealsense2/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 "../work_week.h"
#include <librealsense2/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 "../common/utilities/string/trim-newlines.h"
#include <librealsense2/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 "utilities/string/windows.h"
#include <librealsense2/utilities/string/windows.h>

#include <delayimp.h>

Expand Down
5 changes: 4 additions & 1 deletion include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ target_sources(${LRS_TARGET}
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/h/rs_internal.h"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/h/rs_pipeline.h"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/h/rs_config.h"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/h/rs_advanced_mode_command.h"

"${CMAKE_CURRENT_LIST_DIR}/librealsense2/hpp/rs_types.hpp"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/hpp/rs_context.hpp"
Expand All @@ -33,5 +34,7 @@ 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"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/h/rs_advanced_mode_command.h"

)

include(${CMAKE_CURRENT_LIST_DIR}/librealsense2/utilities/CMakeLists.txt)
9 changes: 9 additions & 0 deletions include/librealsense2/utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2022 Intel Corporation. All Rights Reserved.

include(${CMAKE_CURRENT_LIST_DIR}/easylogging/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/concurrency/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/time/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/number/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/os/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/string/CMakeLists.txt)
7 changes: 7 additions & 0 deletions include/librealsense2/utilities/concurrency/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2022 Intel Corporation. All Rights Reserved.

target_sources(${LRS_TARGET}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/concurrency.h"
"${CMAKE_CURRENT_LIST_DIR}/dispatcher.cpp")
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// Copyright(c) 2021 Intel Corporation. All Rights Reserved.

#include "concurrency.h"
#include "types.h"
#include "../common/utilities/time/waiting-on.h"

#include <librealsense2/utilities/easylogging/easyloggingpp.h>
#include <librealsense2/utilities/time/waiting-on.h>

dispatcher::dispatcher( unsigned int cap, std::function< void( action ) > on_drop_callback )
: _queue( cap, on_drop_callback )
Expand Down
6 changes: 6 additions & 0 deletions include/librealsense2/utilities/easylogging/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2022 Intel Corporation. All Rights Reserved.

target_sources(${LRS_TARGET}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/easyloggingpp.h")
File renamed without changes.
6 changes: 6 additions & 0 deletions include/librealsense2/utilities/number/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2022 Intel Corporation. All Rights Reserved.

target_sources(${LRS_TARGET}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/stabilized-value.h")
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <functional>
#include <comdef.h>
#include <sstream>
#include "../string/windows.h"
#include <librealsense2/utilities/string/windows.h>

namespace utilities {
namespace hresult {
Expand Down
16 changes: 16 additions & 0 deletions include/librealsense2/utilities/string/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2022 Intel Corporation. All Rights Reserved.

SET(STRING_TARGETS "${CMAKE_CURRENT_LIST_DIR}/split.h"
"${CMAKE_CURRENT_LIST_DIR}/string-utilities.h"
"${CMAKE_CURRENT_LIST_DIR}/trim-newlines.h")

if(WIN32)
SET(STRING_TARGETS ${STRING_TARGETS} "${CMAKE_CURRENT_LIST_DIR}/windows.h")
endif()


target_sources(${LRS_TARGET}
PRIVATE
${STRING_TARGETS})

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions include/librealsense2/utilities/time/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2022 Intel Corporation. All Rights Reserved.

target_sources(${LRS_TARGET}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/common.h"
"${CMAKE_CURRENT_LIST_DIR}/periodic-timer.h"
"${CMAKE_CURRENT_LIST_DIR}/stopwatch.h"
"${CMAKE_CURRENT_LIST_DIR}/timer.h"
"${CMAKE_CURRENT_LIST_DIR}/waiting-on.h"
"${CMAKE_CURRENT_LIST_DIR}/work-week.h"
"${CMAKE_CURRENT_LIST_DIR}/work-week.cpp")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 34d3576

Please sign in to comment.