From 00e36598293a592911ede82520b9483cb2d6fa9a Mon Sep 17 00:00:00 2001 From: Claudio Fantacci Date: Fri, 22 Mar 2019 16:11:14 +0100 Subject: [PATCH 1/2] [realsense2] Update to v2.19.0 --- ports/realsense2/CONTROL | 2 +- ports/realsense2/libtm.patch | 214 +++++++++++++++++++++++++++ ports/realsense2/portfile.cmake | 38 ++--- ports/realsense2/windowsconfig.patch | 15 ++ 4 files changed, 250 insertions(+), 19 deletions(-) create mode 100644 ports/realsense2/libtm.patch create mode 100644 ports/realsense2/windowsconfig.patch diff --git a/ports/realsense2/CONTROL b/ports/realsense2/CONTROL index 435f49cd07f602..9711479e49dc33 100644 --- a/ports/realsense2/CONTROL +++ b/ports/realsense2/CONTROL @@ -1,5 +1,5 @@ Source: realsense2 -Version: 2.16.1-1 +Version: 2.19.0 Description: Intel® RealSense™ SDK 2.0 is a cross-platform library for Intel® RealSense™ depth cameras (D400 series and the SR300). Feature: tools diff --git a/ports/realsense2/libtm.patch b/ports/realsense2/libtm.patch new file mode 100644 index 00000000000000..c964440be17af3 --- /dev/null +++ b/ports/realsense2/libtm.patch @@ -0,0 +1,214 @@ +diff --git a/third-party/libtm/resources/CMakeLists.txt b/third-party/libtm/resources/CMakeLists.txt +index 5d6ee17d..f7ae6ce5 100644 +--- a/third-party/libtm/resources/CMakeLists.txt ++++ b/third-party/libtm/resources/CMakeLists.txt +@@ -46,7 +46,7 @@ function(from_hex HEX DEC) + + string(LENGTH "${HEX}" _strlen) + endwhile() +- ++ + set(${DEC} ${_res} PARENT_SCOPE) + endfunction() + +@@ -109,24 +109,25 @@ if(FW_VERSION) + file(REMOVE ${FW_OUTPUT_FILE_TMP}) + message(STATUS " Converting FW version ${FW_VERSION} from target.mvcmd to ${FW_OUTPUT_FILE}") + +- # Create empty output file +- file(WRITE ${FW_OUTPUT_FILE_TMP} "") +- file(APPEND ${FW_OUTPUT_FILE_TMP} "/*******************************************************************************\n") +- file(APPEND ${FW_OUTPUT_FILE_TMP} "INTEL CORPORATION PROPRIETARY INFORMATION\n") +- file(APPEND ${FW_OUTPUT_FILE_TMP} "Copyright(c) 2017 Intel Corporation. All Rights Reserved.\n") +- file(APPEND ${FW_OUTPUT_FILE_TMP} "*******************************************************************************/\n\n") +- file(APPEND ${FW_OUTPUT_FILE_TMP} "#ifndef target_h\n") +- file(APPEND ${FW_OUTPUT_FILE_TMP} "#define target_h\n\n") +- file(APPEND ${FW_OUTPUT_FILE_TMP} "#define FW_VERSION \"${FW_VERSION}\"\n\n") +- file(APPEND ${FW_OUTPUT_FILE_TMP} "static uint32_t target_hex [] = {\n") +- ++ # Covert binary to header-compatible content + bin2h(${LIBTM_RESOURCES_DIR}/target.mvcmd 0 fw_ready_buffer) + +- file(APPEND ${FW_OUTPUT_FILE_TMP} "${fw_ready_buffer}\n") +- file(APPEND ${FW_OUTPUT_FILE_TMP} "};\n") +- file(APPEND ${FW_OUTPUT_FILE_TMP} "#endif\n") +- +- # Checking if current FW is identical to downloaded FW, and remove new one to avoid libtm recompilation ++ # Create empty output file ++ file(WRITE ${FW_OUTPUT_FILE_TMP} ++ "/*******************************************************************************\n ++ INTEL CORPORATION PROPRIETARY INFORMATION\n ++ Copyright(c) 2017 Intel Corporation. All Rights Reserved.\n ++ *******************************************************************************/\n\n ++ #ifndef target_h\n ++ #define target_h\n\n ++ #define FW_VERSION \"${FW_VERSION}\"\n\n ++ static uint32_t target_hex [] = {\n ++ ${fw_ready_buffer}\n ++ };\n ++ #endif\n" ++ ) ++ ++ # Checking if current FW is identical to downloaded FW, and remove new one to avoid libtm recompilation + if(EXISTS "${FW_OUTPUT_FILE}") + # message(STATUS "Local file ${FW_OUTPUT_FILE} already exists, comparing with downloaded FW file") + execute_process( COMMAND ${CMAKE_COMMAND} -E compare_files "${FW_OUTPUT_FILE}" "${FW_OUTPUT_FILE_TMP}" RESULT_VARIABLE compare_result OUTPUT_QUIET ERROR_QUIET) +@@ -151,7 +152,7 @@ if(FW_VERSION) + message(STATUS " Already created ${FW_OUTPUT_FILE}") + endif() + endif() +-endif(FW_VERSION) ++endif(FW_VERSION) + + + if(CENTRAL_APP_VERSION) +@@ -159,7 +160,7 @@ if(CENTRAL_APP_VERSION) + + if (FW_SOURCE MATCHES "Remote") + file(REMOVE ${LIBTM_RESOURCES_DIR}/central_app.bin) +- message(STATUS "- Downloading Central App ${CENTRAL_APP_VERSION} from ${CENTRAL_APP_ARTIFACTORY_DIR}/${CENTRAL_APP_VERSION}/central_app-${CENTRAL_APP_VERSION}.bin") ++ message(STATUS "- Downloading Central App ${CENTRAL_APP_VERSION} from ${CENTRAL_APP_ARTIFACTORY_DIR}/${CENTRAL_APP_VERSION}/central_app-${CENTRAL_APP_VERSION}.bin") + file(DOWNLOAD "${CENTRAL_APP_ARTIFACTORY_DIR}/${CENTRAL_APP_VERSION}/central_app-${CENTRAL_APP_VERSION}.bin" "${LIBTM_RESOURCES_DIR}/central_app.bin" TIMEOUT 60 STATUS status LOG log) + # message(STATUS "Downloading Central App ${CENTRAL_APP_VERSION} completed - status ${status}") + list (FIND status "\"No error\"" _index) +@@ -173,7 +174,7 @@ if(CENTRAL_APP_VERSION) + message(STATUS "- Downloading Central App ${CENTRAL_APP_VERSION} skipped") + endif() + endif() +- ++ + if (FW_SOURCE MATCHES "Remote" OR FW_SOURCE MATCHES "Local") + file(REMOVE ${CENTRAL_APP_OUTPUT_FILE_TMP}) + message(STATUS " Converting Central App version ${CENTRAL_APP_VERSION} from central_app.bin to ${CENTRAL_APP_OUTPUT_FILE}") +@@ -190,7 +191,7 @@ if(CENTRAL_APP_VERSION) + # uint32 file_format_version; // defines the format of both header and data + # uint32 version_size; + # uint8 version[] +- # Data: ++ # Data: + # uint8 data[]; + + # Read 1 byte of file_format_version and abort if not supported +@@ -222,9 +223,9 @@ if(CENTRAL_APP_VERSION) + endif() + + # Check if internal central FW version is compatible with file name +- if (NOT ${central_app_version_major} EQUAL ${central_app_major_version} OR +- NOT ${central_app_version_minor} EQUAL ${central_app_minor_version} OR +- NOT ${central_app_version_patch} EQUAL ${central_app_patch_version} OR ++ if (NOT ${central_app_version_major} EQUAL ${central_app_major_version} OR ++ NOT ${central_app_version_minor} EQUAL ${central_app_minor_version} OR ++ NOT ${central_app_version_patch} EQUAL ${central_app_patch_version} OR + NOT ${central_app_version_build} EQUAL ${central_app_build_version}) + message(FATAL_ERROR " Wrong Central FW version (${central_app_version_major}.${central_app_version_minor}.${central_app_version_patch}.${central_app_version_build}) VS (${central_app_major_version}.${central_app_minor_version}.${central_app_patch_version}.${central_app_build_version})") + endif() +@@ -236,27 +237,27 @@ if(CENTRAL_APP_VERSION) + # message(STATUS "- version_size = ${central_app_version_size}") + # message(STATUS "- version = ${central_app_version_major}.${central_app_version_minor}.${central_app_version_patch}.${central_app_version_build}") + +- # Create empty output file +- file(WRITE ${CENTRAL_APP_OUTPUT_FILE_TMP} "") +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "/*******************************************************************************\n") +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "INTEL CORPORATION PROPRIETARY INFORMATION\n") +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "Copyright(c) 2017 Intel Corporation. All Rights Reserved.\n") +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "*******************************************************************************/\n\n") +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "#ifndef CentralAppFw_h\n") +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "#define CentralAppFw_h\n\n") +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "#define CENTRAL_APP_VERSION \"${CENTRAL_APP_VERSION}\"\n") +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "#define CENTRAL_APP_SIZE ${central_app_data_size}\n\n") +- +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "namespace CentralAppFw {\n\n") +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "const int Version[] = { ${central_app_major_version}, ${central_app_minor_version}, ${central_app_patch_version}, ${central_app_build_version} };\n") +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "const uint32_t Buffer [] = {\n") +- ++ # Covert binary to header-compatible content + bin2h(${LIBTM_RESOURCES_DIR}/central_app.bin ${central_app_header_size} central_app_ready_buffer) +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "${central_app_ready_buffer}\n") + +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "};\n") +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "}\n") +- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "#endif\n") ++ # Create empty output file ++ file(WRITE ${CENTRAL_APP_OUTPUT_FILE_TMP} ++ "/*******************************************************************************\n ++ INTEL CORPORATION PROPRIETARY INFORMATION\n ++ Copyright(c) 2017 Intel Corporation. All Rights Reserved.\n ++ *******************************************************************************/\n\n ++ #ifndef CentralAppFw_h\n ++ #define CentralAppFw_h\n\n ++ #define CENTRAL_APP_VERSION \"${CENTRAL_APP_VERSION}\"\n ++ #define CENTRAL_APP_SIZE ${central_app_data_size}\n\n ++ namespace CentralAppFw {\n\n ++ const int Version[] = { ${central_app_major_version}, ${central_app_minor_version}, ${central_app_patch_version}, ${central_app_build_version} };\n ++ const uint32_t Buffer [] = {\n ++ ${central_app_ready_buffer}\n ++ };\n ++ }\n ++ #endif\n" ++ ) + + # Checking if current central APP is identical to downloaded central APP, and remove new one to avoid libtm recompilation + if(EXISTS "${CENTRAL_APP_OUTPUT_FILE}") +@@ -284,7 +285,7 @@ if(CENTRAL_APP_VERSION) + endif() + endif() + +-endif(CENTRAL_APP_VERSION) ++endif(CENTRAL_APP_VERSION) + + + if(CENTRAL_BL_VERSION) +@@ -316,26 +317,26 @@ if(CENTRAL_BL_VERSION) + STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" central_bl_patch_version "${CENTRAL_BL_VERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" central_bl_build_version "${CENTRAL_BL_VERSION}") + +- # Create empty output file +- file(WRITE ${CENTRAL_BL_OUTPUT_FILE_TMP} "") +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "/*******************************************************************************\n") +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "INTEL CORPORATION PROPRIETARY INFORMATION\n") +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "Copyright(c) 2017 Intel Corporation. All Rights Reserved.\n") +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "*******************************************************************************/\n\n") +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "#ifndef CentralBlFw_h\n") +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "#define CentralBlFw_h\n\n") +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "#define CENTRAL_BL_VERSION \"${CENTRAL_BL_VERSION}\"\n\n") +- +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "namespace CentralBlFw {\n\n") +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "const int Version[] = { ${central_bl_major_version}, ${central_bl_minor_version}, ${central_bl_patch_version}, ${central_bl_build_version} };\n") +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "const uint32_t Buffer [] = {\n") +- ++ # Covert binary to header-compatible content + bin2h(${LIBTM_RESOURCES_DIR}/central_bl.bin 3 central_bl_ready_buffer) +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "${central_bl_ready_buffer}\n") + +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "};\n") +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "}\n") +- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "#endif\n") ++ # Create empty output file ++ file(WRITE ${CENTRAL_BL_OUTPUT_FILE_TMP} ++ "/*******************************************************************************\n ++ INTEL CORPORATION PROPRIETARY INFORMATION\n ++ Copyright(c) 2017 Intel Corporation. All Rights Reserved.\n ++ *******************************************************************************/\n\n ++ #ifndef CentralBlFw_h\n ++ #define CentralBlFw_h\n\n ++ #define CENTRAL_BL_VERSION \"${CENTRAL_BL_VERSION}\"\n\n ++ namespace CentralBlFw {\n\n ++ const int Version[] = { ${central_bl_major_version}, ${central_bl_minor_version}, ${central_bl_patch_version}, ${central_bl_build_version} };\n ++ const uint32_t Buffer [] = {\n ++ ${central_bl_ready_buffer}\n ++ };\n ++ }\n ++ #endif\n" ++ ) + + # Checking if current central BL is identical to downloaded central BL, and remove new one to avoid libtm recompilation + if(EXISTS "${CENTRAL_BL_OUTPUT_FILE}") +@@ -363,7 +364,7 @@ if(CENTRAL_BL_VERSION) + endif() + endif() + +-endif(CENTRAL_BL_VERSION) ++endif(CENTRAL_BL_VERSION) + + + # Update versions.log & remote_versions.log file diff --git a/ports/realsense2/portfile.cmake b/ports/realsense2/portfile.cmake index 8db63f04d6594b..4719cc9be5b168 100644 --- a/ports/realsense2/portfile.cmake +++ b/ports/realsense2/portfile.cmake @@ -3,48 +3,53 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO IntelRealSense/librealsense - REF v2.16.1 - SHA512 e030f7b1833db787b8976ead734535fb2209a19317d74d4f68bd8f8cae38abe2343d584e88131a1a66bf6f9f1c0a17bc2c64540841a74cf6300fecf3e69f9dff + REF v2.19.0 + SHA512 c1fcb2b11827a5518b1e5196b7d1d2406447c6b2301809d3c66aaf69363a36f9789fd33595f581846809eba2c2540d3add964da03ecd96c804c7ca2b2df85180 HEAD_REF development + PATCHES + libtm.patch + windowsconfig.patch ) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_LIBRARY_LINKAGE) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_CRT_LINKAGE) set(BUILD_EXAMPLES OFF) set(BUILD_GRAPHICAL_EXAMPLES OFF) if("tools" IN_LIST FEATURES) - set(BUILD_EXAMPLES ON) - set(BUILD_GRAPHICAL_EXAMPLES ON) + set(BUILD_EXAMPLES ON) + set(BUILD_GRAPHICAL_EXAMPLES ON) endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA OPTIONS - #Ungrouped Entries + # Ungrouped Entries -DENFORCE_METADATA=ON + # BUILD + -DBUILD_WITH_STATIC_CRT=${BUILD_CRT_LINKAGE} + -DBUILD_WITH_TM2=OFF + OPTIONS_RELEASE # BUILD -DBUILD_EXAMPLES=${BUILD_EXAMPLES} -DBUILD_GRAPHICAL_EXAMPLES=${BUILD_GRAPHICAL_EXAMPLES} - -DBUILD_SHARED_LIBS=${BUILD_LIBRARY_LINKAGE} - -DBUILD_UNIT_TESTS=OFF - -DBUILD_WITH_OPENMP=OFF - -DBUILD_WITH_STATIC_CRT=${BUILD_CRT_LINKAGE} OPTIONS_DEBUG # BUILD -DBUILD_EXAMPLES=OFF -DBUILD_GRAPHICAL_EXAMPLES=OFF # CMAKE - -DCMAKE_PDB_OUTPUT_DIRECTORY=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - -DCMAKE_DEBUG_POSTFIX=_d + -DCMAKE_DEBUG_POSTFIX=d ) vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/realsense2) vcpkg_copy_pdbs() +file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/libtm_util.exe) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/libtm_util.exe) if(BUILD_EXAMPLES) file(GLOB EXEFILES_RELEASE ${CURRENT_PACKAGES_DIR}/bin/rs-* ${CURRENT_PACKAGES_DIR}/bin/realsense-*) @@ -52,10 +57,7 @@ if(BUILD_EXAMPLES) file(COPY ${EXEFILES_RELEASE} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/realsense2) file(REMOVE ${EXEFILES_RELEASE}) endif() - file(GLOB EXEFILES_DEBUG ${CURRENT_PACKAGES_DIR}/debug/bin/*) - if (EXEFILES_DEBUG) - file(REMOVE ${EXEFILES_RELEASE} ${EXEFILES_DEBUG}) - endif() + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/realsense2) file(GLOB BINS ${CURRENT_PACKAGES_DIR}/bin/*) @@ -64,5 +66,5 @@ if(BUILD_EXAMPLES) endif() endif() -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/realsense2) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/realsense2/COPYING ${CURRENT_PACKAGES_DIR}/share/realsense2/copyright) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/realsense2) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/realsense2/LICENSE ${CURRENT_PACKAGES_DIR}/share/realsense2/copyright) diff --git a/ports/realsense2/windowsconfig.patch b/ports/realsense2/windowsconfig.patch new file mode 100644 index 00000000000000..5b88f1c36f79d3 --- /dev/null +++ b/ports/realsense2/windowsconfig.patch @@ -0,0 +1,15 @@ +diff --git a/CMake/windows_config.cmake b/CMake/windows_config.cmake +index afde45c7..e1d87d22 100644 +--- a/CMake/windows_config.cmake ++++ b/CMake/windows_config.cmake +@@ -38,7 +38,9 @@ macro(os_set_flags) + add_definitions(-DNOMINMAX) + endif() + +- include(CMake/external_libusb.cmake) ++ if(BUILD_WITH_TM2) ++ include(CMake/external_libusb.cmake) ++ endif() + endmacro() + + macro(os_target_config) From c7a4fe7a169fcf2c6fb1e3efd8eace3ccc624bbd Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Wed, 12 Jun 2019 11:27:31 -0700 Subject: [PATCH 2/2] [realsense2] Update to version 2.22.0 --- ports/realsense2/CONTROL | 4 +- ports/realsense2/libtm.patch | 214 --------------------------- ports/realsense2/portfile.cmake | 30 ++-- ports/realsense2/windowsconfig.patch | 15 -- 4 files changed, 14 insertions(+), 249 deletions(-) delete mode 100644 ports/realsense2/libtm.patch delete mode 100644 ports/realsense2/windowsconfig.patch diff --git a/ports/realsense2/CONTROL b/ports/realsense2/CONTROL index 71ee9d40c39ddf..c32e586ec62513 100644 --- a/ports/realsense2/CONTROL +++ b/ports/realsense2/CONTROL @@ -1,7 +1,7 @@ Source: realsense2 -Version: 2.19.0 +Version: 2.22.0 Description: Intel® RealSense™ SDK 2.0 is a cross-platform library for Intel® RealSense™ depth cameras (D400 series and the SR300). Feature: tools Build-Depends: opengl -Description: Build Intel® RealSense™ examples and tools \ No newline at end of file +Description: Build Intel® RealSense™ examples and tools diff --git a/ports/realsense2/libtm.patch b/ports/realsense2/libtm.patch deleted file mode 100644 index c964440be17af3..00000000000000 --- a/ports/realsense2/libtm.patch +++ /dev/null @@ -1,214 +0,0 @@ -diff --git a/third-party/libtm/resources/CMakeLists.txt b/third-party/libtm/resources/CMakeLists.txt -index 5d6ee17d..f7ae6ce5 100644 ---- a/third-party/libtm/resources/CMakeLists.txt -+++ b/third-party/libtm/resources/CMakeLists.txt -@@ -46,7 +46,7 @@ function(from_hex HEX DEC) - - string(LENGTH "${HEX}" _strlen) - endwhile() -- -+ - set(${DEC} ${_res} PARENT_SCOPE) - endfunction() - -@@ -109,24 +109,25 @@ if(FW_VERSION) - file(REMOVE ${FW_OUTPUT_FILE_TMP}) - message(STATUS " Converting FW version ${FW_VERSION} from target.mvcmd to ${FW_OUTPUT_FILE}") - -- # Create empty output file -- file(WRITE ${FW_OUTPUT_FILE_TMP} "") -- file(APPEND ${FW_OUTPUT_FILE_TMP} "/*******************************************************************************\n") -- file(APPEND ${FW_OUTPUT_FILE_TMP} "INTEL CORPORATION PROPRIETARY INFORMATION\n") -- file(APPEND ${FW_OUTPUT_FILE_TMP} "Copyright(c) 2017 Intel Corporation. All Rights Reserved.\n") -- file(APPEND ${FW_OUTPUT_FILE_TMP} "*******************************************************************************/\n\n") -- file(APPEND ${FW_OUTPUT_FILE_TMP} "#ifndef target_h\n") -- file(APPEND ${FW_OUTPUT_FILE_TMP} "#define target_h\n\n") -- file(APPEND ${FW_OUTPUT_FILE_TMP} "#define FW_VERSION \"${FW_VERSION}\"\n\n") -- file(APPEND ${FW_OUTPUT_FILE_TMP} "static uint32_t target_hex [] = {\n") -- -+ # Covert binary to header-compatible content - bin2h(${LIBTM_RESOURCES_DIR}/target.mvcmd 0 fw_ready_buffer) - -- file(APPEND ${FW_OUTPUT_FILE_TMP} "${fw_ready_buffer}\n") -- file(APPEND ${FW_OUTPUT_FILE_TMP} "};\n") -- file(APPEND ${FW_OUTPUT_FILE_TMP} "#endif\n") -- -- # Checking if current FW is identical to downloaded FW, and remove new one to avoid libtm recompilation -+ # Create empty output file -+ file(WRITE ${FW_OUTPUT_FILE_TMP} -+ "/*******************************************************************************\n -+ INTEL CORPORATION PROPRIETARY INFORMATION\n -+ Copyright(c) 2017 Intel Corporation. All Rights Reserved.\n -+ *******************************************************************************/\n\n -+ #ifndef target_h\n -+ #define target_h\n\n -+ #define FW_VERSION \"${FW_VERSION}\"\n\n -+ static uint32_t target_hex [] = {\n -+ ${fw_ready_buffer}\n -+ };\n -+ #endif\n" -+ ) -+ -+ # Checking if current FW is identical to downloaded FW, and remove new one to avoid libtm recompilation - if(EXISTS "${FW_OUTPUT_FILE}") - # message(STATUS "Local file ${FW_OUTPUT_FILE} already exists, comparing with downloaded FW file") - execute_process( COMMAND ${CMAKE_COMMAND} -E compare_files "${FW_OUTPUT_FILE}" "${FW_OUTPUT_FILE_TMP}" RESULT_VARIABLE compare_result OUTPUT_QUIET ERROR_QUIET) -@@ -151,7 +152,7 @@ if(FW_VERSION) - message(STATUS " Already created ${FW_OUTPUT_FILE}") - endif() - endif() --endif(FW_VERSION) -+endif(FW_VERSION) - - - if(CENTRAL_APP_VERSION) -@@ -159,7 +160,7 @@ if(CENTRAL_APP_VERSION) - - if (FW_SOURCE MATCHES "Remote") - file(REMOVE ${LIBTM_RESOURCES_DIR}/central_app.bin) -- message(STATUS "- Downloading Central App ${CENTRAL_APP_VERSION} from ${CENTRAL_APP_ARTIFACTORY_DIR}/${CENTRAL_APP_VERSION}/central_app-${CENTRAL_APP_VERSION}.bin") -+ message(STATUS "- Downloading Central App ${CENTRAL_APP_VERSION} from ${CENTRAL_APP_ARTIFACTORY_DIR}/${CENTRAL_APP_VERSION}/central_app-${CENTRAL_APP_VERSION}.bin") - file(DOWNLOAD "${CENTRAL_APP_ARTIFACTORY_DIR}/${CENTRAL_APP_VERSION}/central_app-${CENTRAL_APP_VERSION}.bin" "${LIBTM_RESOURCES_DIR}/central_app.bin" TIMEOUT 60 STATUS status LOG log) - # message(STATUS "Downloading Central App ${CENTRAL_APP_VERSION} completed - status ${status}") - list (FIND status "\"No error\"" _index) -@@ -173,7 +174,7 @@ if(CENTRAL_APP_VERSION) - message(STATUS "- Downloading Central App ${CENTRAL_APP_VERSION} skipped") - endif() - endif() -- -+ - if (FW_SOURCE MATCHES "Remote" OR FW_SOURCE MATCHES "Local") - file(REMOVE ${CENTRAL_APP_OUTPUT_FILE_TMP}) - message(STATUS " Converting Central App version ${CENTRAL_APP_VERSION} from central_app.bin to ${CENTRAL_APP_OUTPUT_FILE}") -@@ -190,7 +191,7 @@ if(CENTRAL_APP_VERSION) - # uint32 file_format_version; // defines the format of both header and data - # uint32 version_size; - # uint8 version[] -- # Data: -+ # Data: - # uint8 data[]; - - # Read 1 byte of file_format_version and abort if not supported -@@ -222,9 +223,9 @@ if(CENTRAL_APP_VERSION) - endif() - - # Check if internal central FW version is compatible with file name -- if (NOT ${central_app_version_major} EQUAL ${central_app_major_version} OR -- NOT ${central_app_version_minor} EQUAL ${central_app_minor_version} OR -- NOT ${central_app_version_patch} EQUAL ${central_app_patch_version} OR -+ if (NOT ${central_app_version_major} EQUAL ${central_app_major_version} OR -+ NOT ${central_app_version_minor} EQUAL ${central_app_minor_version} OR -+ NOT ${central_app_version_patch} EQUAL ${central_app_patch_version} OR - NOT ${central_app_version_build} EQUAL ${central_app_build_version}) - message(FATAL_ERROR " Wrong Central FW version (${central_app_version_major}.${central_app_version_minor}.${central_app_version_patch}.${central_app_version_build}) VS (${central_app_major_version}.${central_app_minor_version}.${central_app_patch_version}.${central_app_build_version})") - endif() -@@ -236,27 +237,27 @@ if(CENTRAL_APP_VERSION) - # message(STATUS "- version_size = ${central_app_version_size}") - # message(STATUS "- version = ${central_app_version_major}.${central_app_version_minor}.${central_app_version_patch}.${central_app_version_build}") - -- # Create empty output file -- file(WRITE ${CENTRAL_APP_OUTPUT_FILE_TMP} "") -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "/*******************************************************************************\n") -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "INTEL CORPORATION PROPRIETARY INFORMATION\n") -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "Copyright(c) 2017 Intel Corporation. All Rights Reserved.\n") -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "*******************************************************************************/\n\n") -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "#ifndef CentralAppFw_h\n") -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "#define CentralAppFw_h\n\n") -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "#define CENTRAL_APP_VERSION \"${CENTRAL_APP_VERSION}\"\n") -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "#define CENTRAL_APP_SIZE ${central_app_data_size}\n\n") -- -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "namespace CentralAppFw {\n\n") -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "const int Version[] = { ${central_app_major_version}, ${central_app_minor_version}, ${central_app_patch_version}, ${central_app_build_version} };\n") -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "const uint32_t Buffer [] = {\n") -- -+ # Covert binary to header-compatible content - bin2h(${LIBTM_RESOURCES_DIR}/central_app.bin ${central_app_header_size} central_app_ready_buffer) -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "${central_app_ready_buffer}\n") - -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "};\n") -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "}\n") -- file(APPEND ${CENTRAL_APP_OUTPUT_FILE_TMP} "#endif\n") -+ # Create empty output file -+ file(WRITE ${CENTRAL_APP_OUTPUT_FILE_TMP} -+ "/*******************************************************************************\n -+ INTEL CORPORATION PROPRIETARY INFORMATION\n -+ Copyright(c) 2017 Intel Corporation. All Rights Reserved.\n -+ *******************************************************************************/\n\n -+ #ifndef CentralAppFw_h\n -+ #define CentralAppFw_h\n\n -+ #define CENTRAL_APP_VERSION \"${CENTRAL_APP_VERSION}\"\n -+ #define CENTRAL_APP_SIZE ${central_app_data_size}\n\n -+ namespace CentralAppFw {\n\n -+ const int Version[] = { ${central_app_major_version}, ${central_app_minor_version}, ${central_app_patch_version}, ${central_app_build_version} };\n -+ const uint32_t Buffer [] = {\n -+ ${central_app_ready_buffer}\n -+ };\n -+ }\n -+ #endif\n" -+ ) - - # Checking if current central APP is identical to downloaded central APP, and remove new one to avoid libtm recompilation - if(EXISTS "${CENTRAL_APP_OUTPUT_FILE}") -@@ -284,7 +285,7 @@ if(CENTRAL_APP_VERSION) - endif() - endif() - --endif(CENTRAL_APP_VERSION) -+endif(CENTRAL_APP_VERSION) - - - if(CENTRAL_BL_VERSION) -@@ -316,26 +317,26 @@ if(CENTRAL_BL_VERSION) - STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" central_bl_patch_version "${CENTRAL_BL_VERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" central_bl_build_version "${CENTRAL_BL_VERSION}") - -- # Create empty output file -- file(WRITE ${CENTRAL_BL_OUTPUT_FILE_TMP} "") -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "/*******************************************************************************\n") -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "INTEL CORPORATION PROPRIETARY INFORMATION\n") -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "Copyright(c) 2017 Intel Corporation. All Rights Reserved.\n") -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "*******************************************************************************/\n\n") -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "#ifndef CentralBlFw_h\n") -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "#define CentralBlFw_h\n\n") -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "#define CENTRAL_BL_VERSION \"${CENTRAL_BL_VERSION}\"\n\n") -- -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "namespace CentralBlFw {\n\n") -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "const int Version[] = { ${central_bl_major_version}, ${central_bl_minor_version}, ${central_bl_patch_version}, ${central_bl_build_version} };\n") -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "const uint32_t Buffer [] = {\n") -- -+ # Covert binary to header-compatible content - bin2h(${LIBTM_RESOURCES_DIR}/central_bl.bin 3 central_bl_ready_buffer) -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "${central_bl_ready_buffer}\n") - -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "};\n") -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "}\n") -- file(APPEND ${CENTRAL_BL_OUTPUT_FILE_TMP} "#endif\n") -+ # Create empty output file -+ file(WRITE ${CENTRAL_BL_OUTPUT_FILE_TMP} -+ "/*******************************************************************************\n -+ INTEL CORPORATION PROPRIETARY INFORMATION\n -+ Copyright(c) 2017 Intel Corporation. All Rights Reserved.\n -+ *******************************************************************************/\n\n -+ #ifndef CentralBlFw_h\n -+ #define CentralBlFw_h\n\n -+ #define CENTRAL_BL_VERSION \"${CENTRAL_BL_VERSION}\"\n\n -+ namespace CentralBlFw {\n\n -+ const int Version[] = { ${central_bl_major_version}, ${central_bl_minor_version}, ${central_bl_patch_version}, ${central_bl_build_version} };\n -+ const uint32_t Buffer [] = {\n -+ ${central_bl_ready_buffer}\n -+ };\n -+ }\n -+ #endif\n" -+ ) - - # Checking if current central BL is identical to downloaded central BL, and remove new one to avoid libtm recompilation - if(EXISTS "${CENTRAL_BL_OUTPUT_FILE}") -@@ -363,7 +364,7 @@ if(CENTRAL_BL_VERSION) - endif() - endif() - --endif(CENTRAL_BL_VERSION) -+endif(CENTRAL_BL_VERSION) - - - # Update versions.log & remote_versions.log file diff --git a/ports/realsense2/portfile.cmake b/ports/realsense2/portfile.cmake index f0181b789bd817..8d5def7c80455f 100644 --- a/ports/realsense2/portfile.cmake +++ b/ports/realsense2/portfile.cmake @@ -3,12 +3,9 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO IntelRealSense/librealsense - REF v2.19.0 - SHA512 c1fcb2b11827a5518b1e5196b7d1d2406447c6b2301809d3c66aaf69363a36f9789fd33595f581846809eba2c2540d3add964da03ecd96c804c7ca2b2df85180 + REF v2.22.0 + SHA512 7595780c1955a2d4a91df5b70ab6366c672f389bc3d2dcb9f2e78a2ea1fc875c65f878103df483205e17f62dfd024ee5f7ccb15afc5d18978d3c25aa071652ab HEAD_REF development - PATCHES - libtm.patch - windowsconfig.patch ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_CRT_LINKAGE) @@ -24,38 +21,35 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - # Ungrouped Entries -DENFORCE_METADATA=ON - # BUILD - -DBUILD_WITH_STATIC_CRT=${BUILD_CRT_LINKAGE} -DBUILD_WITH_TM2=OFF + -DBUILD_WITH_OPENMP=OFF + -DBUILD_UNIT_TESTS=OFF + -DBUILD_WITH_STATIC_CRT=${BUILD_CRT_LINKAGE} OPTIONS_RELEASE - # BUILD -DBUILD_EXAMPLES=${BUILD_EXAMPLES} -DBUILD_GRAPHICAL_EXAMPLES=${BUILD_GRAPHICAL_EXAMPLES} - -DBUILD_UNIT_TESTS=OFF - -DBUILD_WITH_OPENMP=OFF - -DBUILD_WITH_STATIC_CRT=${BUILD_CRT_LINKAGE} OPTIONS_DEBUG - # BUILD -DBUILD_EXAMPLES=OFF -DBUILD_GRAPHICAL_EXAMPLES=OFF - # CMAKE - -DCMAKE_DEBUG_POSTFIX=d ) vcpkg_install_cmake() + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/realsense2) + vcpkg_copy_pdbs() -file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/libtm_util.exe) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/libtm_util.exe) if(BUILD_EXAMPLES) - file(GLOB EXEFILES_RELEASE ${CURRENT_PACKAGES_DIR}/bin/rs-* ${CURRENT_PACKAGES_DIR}/bin/realsense-*) + file(GLOB EXEFILES_RELEASE + ${CURRENT_PACKAGES_DIR}/bin/rs-* + ${CURRENT_PACKAGES_DIR}/bin/realsense-* + ) + if (EXEFILES_RELEASE) file(COPY ${EXEFILES_RELEASE} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/realsense2) file(REMOVE ${EXEFILES_RELEASE}) diff --git a/ports/realsense2/windowsconfig.patch b/ports/realsense2/windowsconfig.patch deleted file mode 100644 index 5b88f1c36f79d3..00000000000000 --- a/ports/realsense2/windowsconfig.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/CMake/windows_config.cmake b/CMake/windows_config.cmake -index afde45c7..e1d87d22 100644 ---- a/CMake/windows_config.cmake -+++ b/CMake/windows_config.cmake -@@ -38,7 +38,9 @@ macro(os_set_flags) - add_definitions(-DNOMINMAX) - endif() - -- include(CMake/external_libusb.cmake) -+ if(BUILD_WITH_TM2) -+ include(CMake/external_libusb.cmake) -+ endif() - endmacro() - - macro(os_target_config)