Adding more dependencies in Windows CI

This commit is contained in:
matlabbe
2026-06-28 19:47:28 -07:00
parent d39733b995
commit c53ce8fe9f
9 changed files with 349 additions and 24 deletions
+6
View File
@@ -12,3 +12,9 @@ compile_flags.txt
tags tags
build_* build_*
*.bak *.bak
# Windows bundle: vcpkg tree, build output, and deps built from source (bundle_windows_deps.bat)
vcpkg/
vcpkg_installed/
vcpkg_binaries/
vcpkg_deps_from_source/
+192 -13
View File
@@ -4,6 +4,8 @@ setlocal enabledelayedexpansion
:: --- CONFIGURATION --- :: --- CONFIGURATION ---
set "VCPKG_ROOT=%~dp0vcpkg" set "VCPKG_ROOT=%~dp0vcpkg"
set "EXPORT_DIR=%~dp0vcpkg_binaries" set "EXPORT_DIR=%~dp0vcpkg_binaries"
:: All deps downloaded/built from source (git clones + the pinned CMake) live here.
set "SRC_DIR=%~dp0vcpkg_deps_from_source"
set "TRIPLET=x64-windows-release" set "TRIPLET=x64-windows-release"
set "SEVENZIP_EXE=C:\Program Files\7-Zip\7z.exe" set "SEVENZIP_EXE=C:\Program Files\7-Zip\7z.exe"
@@ -43,7 +45,9 @@ echo [+] Installing dependencies via vcpkg manifest...
--x-feature=openni2 ^ --x-feature=openni2 ^
--x-feature=gtsam-deps ^ --x-feature=gtsam-deps ^
--x-feature=python ^ --x-feature=python ^
--x-feature=libpointmatcher-deps || exit /b !errorlevel! --x-feature=pdal ^
--x-feature=libpointmatcher-deps ^
--x-feature=libfreenect2-deps || exit /b !errorlevel!
:: 3. Export :: 3. Export
echo [+] Exporting built binaries to raw folder... echo [+] Exporting built binaries to raw folder...
@@ -52,13 +56,7 @@ for /f "usebackq tokens=*" %%i in (`"%VS_LOCATOR%" -latest -property catalog_pro
set TARGET_NAME=vcpkg-export-%VCPKG_COMMIT_SHORT%-x64-%VS_YEAR% set TARGET_NAME=vcpkg-export-%VCPKG_COMMIT_SHORT%-x64-%VS_YEAR%
set TARGET_FULL_PATH=%EXPORT_DIR%\%TARGET_NAME% set TARGET_FULL_PATH=%EXPORT_DIR%\%TARGET_NAME%
if exist "%TARGET_FULL_PATH%" rd /s /q "%TARGET_FULL_PATH%" if exist "%TARGET_FULL_PATH%" rd /s /q "%TARGET_FULL_PATH%"
"%VCPKG_ROOT%\vcpkg.exe" export --raw --output-dir="%EXPORT_DIR%" --triplet=%TRIPLET% || exit /b !errorlevel! "%VCPKG_ROOT%\vcpkg.exe" export --raw --output-dir="%EXPORT_DIR%" --output=%TARGET_NAME% --triplet=%TRIPLET% || exit /b !errorlevel!
:: Find the actual exported folder name (it usually contains a date/hash)
for /d %%i in ("%EXPORT_DIR%\vcpkg-export-20??????-??????") do set "FINAL_EXPORT_PATH=%%i"
echo [+] Rename folder %FINAL_EXPORT_PATH% to %TARGET_NAME%
ren "%FINAL_EXPORT_PATH%" "%TARGET_NAME%" || exit /b !errorlevel!
set "FINAL_EXPORT_PATH=%TARGET_FULL_PATH%" set "FINAL_EXPORT_PATH=%TARGET_FULL_PATH%"
echo [+] Add numpy... echo [+] Add numpy...
@@ -68,6 +66,66 @@ echo [+] Add numpy...
%FINAL_EXPORT_PATH%/installed/%TRIPLET%/tools/python3/python.exe -m pip install "numpy<2" || exit /b !errorlevel! %FINAL_EXPORT_PATH%/installed/%TRIPLET%/tools/python3/python.exe -m pip install "numpy<2" || exit /b !errorlevel!
:: 4. Other dependencies not in vcpkg :: 4. Other dependencies not in vcpkg
:: Everything cloned/downloaded below goes into %SRC_DIR% to keep the repo root clean.
if not exist "%SRC_DIR%" mkdir "%SRC_DIR%"
cd /d "%SRC_DIR%"
:: Kinect for Windows SDK v2 (k4w2): rtabmap's FindKinectSDK2.cmake expects the
:: Microsoft SDK layout (KINECTSDK20_DIR\inc and \Lib\x64), but vcpkg's kinectsdk2
:: port installs vcpkg-style (include\ and lib\). Mirror the bundled headers/lib into
:: the expected layout so it is found with KINECTSDK20_DIR pointing at the export.
echo [+] Arranging Kinect SDK v2 layout for FindKinectSDK2...
set "K4W2_ROOT=%FINAL_EXPORT_PATH%\installed\%TRIPLET%"
robocopy "%K4W2_ROOT%\include" "%K4W2_ROOT%\inc" Kinect*.h Nui*.h /XO >nul
robocopy "%K4W2_ROOT%\lib" "%K4W2_ROOT%\Lib\x64" Kinect20*.lib /XO >nul
:: Robocopy exit codes under 8 mean successful copies/no changes; 8+ is a failure.
if !errorlevel! GEQ 8 (
echo Error: Robocopy failed with exit code !errorlevel!
pause
exit /b !errorlevel!
)
:: orbbec SDK2
echo [+] Building OrbbecSDK_v2...
if not exist OrbbecSDK_v2 (
echo [+] Downloading and applying patch...
git clone https://github.com/orbbec/OrbbecSDK_v2.git
cd OrbbecSDK_v2
git checkout v2.8.7
:: Install the CMake package config under lib/cmake/<pkg> so find_package(OrbbecSDK) works
git apply "%~dp0patches\orbbecsdk_2.8.7.patch"
cd ..
)
cd OrbbecSDK_v2
cmake -S . -B build -GNinja ^
-DVCPKG_MANIFEST_INSTALL=OFF ^
-DVCPKG_TARGET_TRIPLET=x64-windows-release ^
-DVCPKG_INSTALLED_DIR="%FINAL_EXPORT_PATH%\installed" ^
-DCMAKE_TOOLCHAIN_FILE="%FINAL_EXPORT_PATH%\scripts\buildsystems\vcpkg.cmake" ^
-DCMAKE_INSTALL_PREFIX="%FINAL_EXPORT_PATH%\installed\%TRIPLET%" ^
-DCMAKE_BUILD_TYPE=Release ^
-DOB_BUILD_DOCS=OFF ^
-DOB_BUILD_EXAMPLES=OFF ^
-DOB_BUILD_TOOLS=OFF ^
-DOB_INSTALL_EXAMPLES_SOURCE=OFF || exit /b !errorlevel!
cmake --build build --config Release --target install || exit /b !errorlevel!
cd ..
if "%K4A_ROOT_DIR%"=="" (
echo Error: K4A_ROOT_DIR environment variable is not set! Install K4A: https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md
pause
exit /b 1
)
echo Copying Kinect For Azure components...
robocopy "%K4A_ROOT_DIR%\sdk" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\sdk" /E /XO
:: Robocopy exit codes under 8 mean successful copies/no changes.
:: 8 or higher means there was a failure.
if !errorlevel! GEQ 8 (
echo Error: Robocopy failed with exit code !errorlevel!
pause
exit /b !errorlevel!
)
:: libnabo :: libnabo
echo [+] Building libnabo... echo [+] Building libnabo...
if not exist libnabo ( if not exist libnabo (
@@ -76,7 +134,7 @@ if not exist libnabo (
cd libnabo cd libnabo
:: Jan 27, 2022 :: Jan 27, 2022
git checkout c925c47 git checkout c925c47
git apply ../patches/libnabo_c925c47.patch git apply "%~dp0patches\libnabo_c925c47.patch"
cd .. cd ..
) )
cd libnabo cd libnabo
@@ -103,7 +161,7 @@ if not exist libpointmatcher (
cd libpointmatcher cd libpointmatcher
:: Mar 17, 2023 :: Mar 17, 2023
git checkout 7dc58e5 git checkout 7dc58e5
git apply ../patches/pointmatcher_7dc58e5.patch git apply "%~dp0patches\pointmatcher_7dc58e5.patch"
cd .. cd ..
) )
cd libpointmatcher cd libpointmatcher
@@ -136,7 +194,7 @@ if not exist gtsam (
:: June 18, 2025 :: June 18, 2025
git checkout 4.3a0-ros git checkout 4.3a0-ros
git cherry-pick 18af4e6 git cherry-pick 18af4e6
git apply ../patches/gtsam_4_3a0-ros.patch git apply "%~dp0patches\gtsam_4_3a0-ros.patch"
cd .. cd ..
) )
cd gtsam cd gtsam
@@ -167,7 +225,7 @@ if not exist opengv (
cd opengv cd opengv
:: Aug 6, 2020 :: Aug 6, 2020
git checkout 91f4b19c73450833a40e463ad3648aae80b3a7f3 git checkout 91f4b19c73450833a40e463ad3648aae80b3a7f3
git apply ../patches/opengv_91f4b19c.patch git apply "%~dp0patches\opengv_91f4b19c.patch"
cd .. cd ..
) )
cd opengv cd opengv
@@ -182,6 +240,113 @@ cmake -S . -B build -GNinja ^
cmake --build build --config Release --target install || exit /b !errorlevel! cmake --build build --config Release --target install || exit /b !errorlevel!
cd .. cd ..
:: libfreenect2
echo [+] Building libfreenect2...
if not exist libfreenect2 (
echo [+] Downloading and applying patch...
git clone https://github.com/OpenKinect/libfreenect2.git
cd libfreenect2
:: Aug 6, 2021
git checkout v0.2.1
:: Make the installed freenect2Config.cmake relocatable so the prebuilt
:: bundle works after being moved or unzipped elsewhere.
git apply "%~dp0patches\libfreenect2_v0.2.1.patch"
cd ..
)
cd libfreenect2
:: libfreenect2's FindLibUSB.cmake locates libusb via pkg-config. It declares an
:: ancient cmake_minimum_required (2.8.12), which makes FindPkgConfig default
:: PKG_CONFIG_USE_CMAKE_PREFIX_PATH=OFF, so it ignores the vcpkg CMAKE_PREFIX_PATH.
:: Force it ON so the bundle's lib/pkgconfig (libusb-1.0.pc, libturbojpeg.pc) is
:: searched, use the vcpkg-bundled pkgconf, and also set PKG_CONFIG_PATH as a belt.
set "PKG_CONFIG_PATH=%FINAL_EXPORT_PATH%\installed\%TRIPLET%\lib\pkgconfig"
cmake -S . -B build -GNinja ^
-DVCPKG_MANIFEST_INSTALL=OFF ^
-DVCPKG_TARGET_TRIPLET=x64-windows-release ^
-DVCPKG_INSTALLED_DIR="%FINAL_EXPORT_PATH%\installed" ^
-DCMAKE_TOOLCHAIN_FILE="%FINAL_EXPORT_PATH%\scripts\buildsystems\vcpkg.cmake" ^
-DPKG_CONFIG_EXECUTABLE="%FINAL_EXPORT_PATH%\installed\%TRIPLET%\tools\pkgconf\pkgconf.exe" ^
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON ^
-DENABLE_CUDA=OFF ^
-DENABLE_OPENCL=OFF ^
-DCMAKE_INSTALL_PREFIX="%FINAL_EXPORT_PATH%\installed\%TRIPLET%" ^
-DBUILD_SHARED_LIBS=ON || exit /b !errorlevel!
cmake --build build --config Release --target install || exit /b !errorlevel!
cd ..
:: depthai
echo [+] Building depthai...
if not exist depthai-core (
echo [+] Downloading...
git clone https://github.com/luxonis/depthai-core.git
cd depthai-core
:: depthai 2.32.0 (Hunter-based; v2 does NOT use vcpkg/CMake presets)
git checkout v2.32.0
git submodule update --init --recursive
cd ..
)
cd depthai-core
:: v2 and its old Hunter sub-deps declare cmake_minimum_required < 3.5, which
:: CMake 4.x rejects, and CMAKE_POLICY_VERSION_MINIMUM does not propagate into
:: Hunter's sub-builds. Use a pinned CMake 3.x just for depthai (Hunter reuses the
:: same cmake binary for its dependency sub-builds).
set "CMAKE3_VER=3.31.12"
set "CMAKE3_NAME=cmake-%CMAKE3_VER%-windows-x86_64"
set "CMAKE3_DIR=%SRC_DIR%\%CMAKE3_NAME%"
set "CMAKE3=%CMAKE3_DIR%\bin\cmake.exe"
if not exist "%CMAKE3_DIR%" (
echo [+] Downloading CMake %CMAKE3_VER% ...
curl -L -o "%SRC_DIR%\%CMAKE3_NAME%.zip" "https://github.com/Kitware/CMake/releases/download/v%CMAKE3_VER%/%CMAKE3_NAME%.zip" || exit /b !errorlevel!
"%SEVENZIP_EXE%" x "%SRC_DIR%\%CMAKE3_NAME%.zip" -o"%SRC_DIR%" -y || exit /b !errorlevel!
)
:: v2 is fully Hunter-managed (no vcpkg toolchain). depthaiDependencies.cmake
:: unconditionally does find_package(OpenCV 4 QUIET CONFIG) (not gated by
:: DEPTHAI_OPENCV_SUPPORT); if it finds the bundle's OpenCV, OpenCVModules does
:: find_dependency(TIFF) which collides with Hunter's config-less FindTIFF. We don't
:: need depthai's OpenCV at all (CameraDepthAI converts ImgFrame->cv::Mat itself), so
:: hard-disable the lookup. DEPTHAI_ENABLE_CURL=OFF avoids Hunter's old zlib/curl.
"%CMAKE3%" -S . -B build -GNinja ^
-DCMAKE_INSTALL_PREFIX="%FINAL_EXPORT_PATH%\installed\%TRIPLET%" ^
-DCMAKE_BUILD_TYPE=Release ^
-DBUILD_SHARED_LIBS=ON ^
-DDEPTHAI_OPENCV_SUPPORT=OFF ^
-DCMAKE_DISABLE_FIND_PACKAGE_OpenCV=ON ^
-DDEPTHAI_ENABLE_CURL=OFF ^
-DDEPTHAI_BUILD_EXAMPLES=OFF ^
-DDEPTHAI_BUILD_TESTS=OFF || exit /b !errorlevel!
"%CMAKE3%" --build build --config Release --target install || exit /b !errorlevel!
cd ..
:: CCCoreLib
echo [+] Building CCCoreLib...
if not exist CCCoreLib (
echo [+] Downloading...
git clone https://github.com/CloudCompare/CCCoreLib.git
cd CCCoreLib
:: June 20, 2026
git checkout 4095bea6552096cb528c3b8b5cb9505df2aa6002
git submodule update --init --recursive
:: nanoflann is an internal dep (only used in src/Kriging.cpp, no public header),
:: but CCCoreLib links it PUBLIC, leaking nanoflann::nanoflann into the exported
:: interface and breaking find_package(CCCoreLib). Link it PRIVATE instead.
git apply "%~dp0patches\cccorelib_4095bea.patch"
cd ..
)
cd CCCoreLib
cmake -S . -B build -GNinja ^
-DVCPKG_MANIFEST_INSTALL=OFF ^
-DVCPKG_TARGET_TRIPLET=x64-windows-release ^
-DVCPKG_INSTALLED_DIR="%FINAL_EXPORT_PATH%\installed" ^
-DCMAKE_TOOLCHAIN_FILE="%FINAL_EXPORT_PATH%\scripts\buildsystems\vcpkg.cmake" ^
-DCMAKE_INSTALL_PREFIX="%FINAL_EXPORT_PATH%\installed\%TRIPLET%" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCCCORELIB_SHARED=ON ^
-DCCCORELIB_USE_CGAL=OFF ^
-DCCCORELIB_USE_TBB=ON ^
-DCCCORELIB_USE_QT_CONCURRENT=OFF || exit /b !errorlevel!
cmake --build build --config Release --target install || exit /b !errorlevel!
cd ..
:: 5. ZIP the folder :: 5. ZIP the folder
echo [+] Creating final package with 7-Zip... echo [+] Creating final package with 7-Zip...
:: Rip off pdb files :: Rip off pdb files
@@ -205,13 +370,27 @@ if !errorlevel! EQU 0 (
:: Example building rtabmap afterwards :: Example building rtabmap afterwards
goto :EndComment goto :EndComment
:: The vcpkg export folder should be in the rtabmap source directory
:: (otherwise we get some cmake errors about that)
set VCPKG_UNZIPPED_EXPORT_PATH=%USERPROFILE%\Downloads\vcpkg-export-########-x64-vs2022 set VCPKG_UNZIPPED_EXPORT_PATH=%USERPROFILE%\Downloads\vcpkg-export-########-x64-vs2022
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release\bin;%PATH% set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release\bin;%PATH%
set K4A_ROOT_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
set KINECTSDK20_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
cmake -B build -GNinja ^ cmake -B build -GNinja ^
-DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_BUILD_TYPE=Release ^
-DBUILD_AS_BUNDLE=ON -DWITH_PYTHON=ON ^ -DBUILD_AS_BUNDLE=ON ^
-DWITH_PYTHON=ON ^
-DWITH_ZED=OFF ^ -DWITH_ZED=OFF ^
-DWITH_CERES=ON ^
-DWITH_ORBBEC_SDK=ON ^
-DWITH_FREENECT2=ON ^
-DWITH_K4W2=ON ^
-DWITH_K4A=ON ^
-DWITH_DEPTHAI=ON ^
-DWITH_REALSENSE2=ON ^
-DWITH_CCCORELIB=ON ^
-DVCPKG_MANIFEST_INSTALL=OFF ^ -DVCPKG_MANIFEST_INSTALL=OFF ^
-DVCPKG_TARGET_TRIPLET=x64-windows-release ^ -DVCPKG_TARGET_TRIPLET=x64-windows-release ^
-DVCPKG_INSTALLED_DIR="%VCPKG_UNZIPPED_EXPORT_PATH%/installed" ^ -DVCPKG_INSTALLED_DIR="%VCPKG_UNZIPPED_EXPORT_PATH%/installed" ^
+54 -9
View File
@@ -34,6 +34,8 @@ echo Installed CUDA Toolkit: %CUDA_VER%
:: --- CONFIGURATION --- :: --- CONFIGURATION ---
set "VCPKG_ROOT=%~dp0vcpkg" set "VCPKG_ROOT=%~dp0vcpkg"
set "EXPORT_DIR=%~dp0vcpkg_binaries" set "EXPORT_DIR=%~dp0vcpkg_binaries"
:: All deps downloaded/built from source (pytorch, torchvision, opencv, libfreenect2, ...) live here.
set "SRC_DIR=%~dp0vcpkg_deps_from_source"
set "TRIPLET=x64-windows-release" set "TRIPLET=x64-windows-release"
set "SEVENZIP_EXE=C:\Program Files\7-Zip\7z.exe" set "SEVENZIP_EXE=C:\Program Files\7-Zip\7z.exe"
@@ -70,11 +72,34 @@ if not exist "%FINAL_EXPORT_PATH%" (
xcopy "%CUDA_PATH%\bin\x64\cudnn*.dll" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\bin\" /Y xcopy "%CUDA_PATH%\bin\x64\cudnn*.dll" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\bin\" /Y
) )
:: For ZED, modify zed-config.cmake and remove all dependencies
if "%ZED_SDK_ROOT_DIR%"=="" (
echo Error: ZED_SDK_ROOT_DIR environment variable is not set!
pause
exit /b 1
)
echo Copying ZED main library only...
robocopy "%ZED_SDK_ROOT_DIR%\bin" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\bin" *.dll /XF nv*.dll
robocopy "%ZED_SDK_ROOT_DIR%\lib" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\lib" /E /XO
robocopy "%ZED_SDK_ROOT_DIR%\include" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\include" /E /XO
:: Robocopy exit codes under 8 mean successful copies/no changes.
:: 8 or higher means there was a failure.
if !errorlevel! GEQ 8 (
echo Error: Robocopy failed with exit code !errorlevel!
pause
exit /b !errorlevel!
)
:: pytorch deps :: pytorch deps
%FINAL_EXPORT_PATH%/installed/%TRIPLET%/tools/python3/python.exe -m pip install numpy packaging "setuptools<82" pyyaml typing_extensions %FINAL_EXPORT_PATH%/installed/%TRIPLET%/tools/python3/python.exe -m pip install numpy packaging "setuptools<82" pyyaml typing_extensions
git config --global core.longpaths true git config --global core.longpaths true
:: All deps cloned/built below go into %SRC_DIR% (incl. libfreenect2 built by
:: bundle_windows_deps.bat) to keep the repo root clean.
if not exist "%SRC_DIR%" mkdir "%SRC_DIR%"
cd /d "%SRC_DIR%"
:: pytorch, build with local cuda libraries to avoid duplicating them when we install rtabmap :: pytorch, build with local cuda libraries to avoid duplicating them when we install rtabmap
echo [+] Building pytorch with cuda support... echo [+] Building pytorch with cuda support...
if not exist pytorch ( if not exist pytorch (
@@ -124,6 +149,7 @@ set TORCHVISION_LIBRARY=%FINAL_EXPORT_PATH%\installed\%TRIPLET%\lib
%FINAL_EXPORT_PATH%/installed/%TRIPLET%/tools/python3/python.exe -m pip install . -v --no-build-isolation || exit /b !errorlevel! %FINAL_EXPORT_PATH%/installed/%TRIPLET%/tools/python3/python.exe -m pip install . -v --no-build-isolation || exit /b !errorlevel!
cd .. cd ..
:: opencv_cuda :: opencv_cuda
echo [+] Building opencv with cuda support... echo [+] Building opencv with cuda support...
if not exist opencv ( if not exist opencv (
@@ -138,7 +164,7 @@ if not exist opencv (
if not exist opencv_contrib ( if not exist opencv_contrib (
echo [+] Downloading opencv_contrib... echo [+] Downloading opencv_contrib...
git clone https://github.com/opencv/opencv_contrib.git || exit /b !errorlevel! git clone https://github.com/opencv/opencv_contrib.git || exit /b !errorlevel!
cd opencv cd opencv_contrib
:: 4.13.0 minimum required to be compatible with cuda 13 :: 4.13.0 minimum required to be compatible with cuda 13
:: Dec 31, 2025 :: Dec 31, 2025
git checkout 4.13.0 git checkout 4.13.0
@@ -174,6 +200,23 @@ robocopy "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\bin\Lib" "%FINAL_EXPORT_PATH%\
cd .. cd ..
:: freenect2 with cuda support
cd libfreenect2
cmake -S . -B build_cuda -GNinja ^
-DVCPKG_MANIFEST_INSTALL=OFF ^
-DVCPKG_TARGET_TRIPLET=x64-windows-release ^
-DVCPKG_INSTALLED_DIR="%FINAL_EXPORT_PATH%\installed" ^
-DCMAKE_TOOLCHAIN_FILE="%FINAL_EXPORT_PATH%\scripts\buildsystems\vcpkg.cmake" ^
-DPKG_CONFIG_EXECUTABLE="%FINAL_EXPORT_PATH%\installed\%TRIPLET%\tools\pkgconf\pkgconf.exe" ^
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON ^
-DCMAKE_INSTALL_PREFIX="%FINAL_EXPORT_PATH%\installed\%TRIPLET%" ^
-DENABLE_CUDA=ON ^
-DENABLE_OPENCL=ON ^
-DENABLE_OPENGL=ON ^
-DBUILD_SHARED_LIBS=ON || exit /b !errorlevel!
cmake --build build_cuda --config Release --target install || exit /b !errorlevel!
cd ..
:: 5. ZIP the folder :: 5. ZIP the folder
echo [+] Creating final package with 7-Zip... echo [+] Creating final package with 7-Zip...
:: Rip off pdb files :: Rip off pdb files
@@ -196,7 +239,7 @@ if !errorlevel! EQU 0 (
goto :EndComment goto :EndComment
:: Set path of unzipped deps :: Set path of unzipped deps
set VCPKG_UNZIPPED_EXPORT_PATH= set VCPKG_UNZIPPED_EXPORT_PATH=%USERPROFILE%\Downloads\vcpkg-export-########-x64-vs2022
set TRIPLET=x64-windows-release set TRIPLET=x64-windows-release
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%\bin;%PATH% set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%\bin;%PATH%
@@ -206,22 +249,24 @@ set PATH=%CUDA_PATH%\bin\x64;%PATH%
set PATH=%CUDA_PATH%\extras\CUPTI\lib64;%PATH% set PATH=%CUDA_PATH%\extras\CUPTI\lib64;%PATH%
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%\tools\python3\Lib\site-packages\torch\lib;%PATH% set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%\tools\python3\Lib\site-packages\torch\lib;%PATH%
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%\tools\python3\Lib\site-packages\numpy.libs;%PATH% set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%\tools\python3\Lib\site-packages\numpy.libs;%PATH%
set ZED_SDK_ROOT_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
:: Other dependencies :: Other dependencies
:: For ZED, modify zed-config.cmake and remove all dependencies
set PATH=%PATH%;%ZED_SDK_ROOT_DIR%\bin
:: For kinect 4 windows SDK v2, move kinect20.dll from system32 to KINECTSDK20_DIR\bin
:: For kinect 4 windows SDK v1, move kinect10.dll and KinectAudio10.dll to KINECTSDK20_DIR\bin
set PATH=%PATH%;%KINECTSDK20_DIR%\bin
cmake -B build_cuda -GNinja ^ cmake -B build_cuda -GNinja ^
-DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_BUILD_TYPE=Release ^
-DBUILD_AS_BUNDLE=ON ^ -DBUILD_AS_BUNDLE=ON ^
-DWITH_PYTHON=ON ^ -DWITH_PYTHON=ON ^
-DWITH_TORCH=ON ^ -DWITH_TORCH=ON ^
-DWITH_ZED=ON ^ -DWITH_ZED=ON ^
-DWITH_CERES=ON ^
-DWITH_ORBBEC_SDK=ON ^
-DWITH_FREENECT2=ON ^
-DWITH_K4W2=ON ^
-DWITH_K4A=ON ^
-DWITH_DEPTHAI=ON ^
-DWITH_REALSENSE2=ON ^
-DWITH_CCCORELIB=ON ^
-DVCPKG_MANIFEST_INSTALL=OFF ^ -DVCPKG_MANIFEST_INSTALL=OFF ^
-DVCPKG_TARGET_TRIPLET=%TRIPLET% ^ -DVCPKG_TARGET_TRIPLET=%TRIPLET% ^
-DVCPKG_INSTALLED_DIR="%VCPKG_UNZIPPED_EXPORT_PATH%/installed" ^ -DVCPKG_INSTALLED_DIR="%VCPKG_UNZIPPED_EXPORT_PATH%/installed" ^
-1
View File
@@ -392,7 +392,6 @@ IF(depthai_FOUND)
SET(PUBLIC_LIBRARIES SET(PUBLIC_LIBRARIES
${PUBLIC_LIBRARIES} ${PUBLIC_LIBRARIES}
depthai::core depthai::core
depthai::opencv
) )
ENDIF(depthai_FOUND) ENDIF(depthai_FOUND)
+16 -1
View File
@@ -729,6 +729,21 @@ std::string CameraDepthAI::getSerial() const
return ""; return "";
} }
#ifdef RTABMAP_DEPTHAI
namespace {
// Convert the depthai depth ImgFrame to cv::Mat (similar to dai::ImgFrame::getCvFrame())
cv::Mat depthImgFrameToCvMat(const std::shared_ptr<dai::ImgFrame> & frame)
{
if(frame->getType() != dai::ImgFrame::Type::RAW16)
{
UERROR("Expected RAW16 depth ImgFrame but got type %d", (int)frame->getType());
return cv::Mat();
}
return cv::Mat((int)frame->getHeight(), (int)frame->getWidth(), CV_16UC1, frame->getData().data()).clone();
}
}
#endif
SensorData CameraDepthAI::captureImage(SensorCaptureInfo * info) SensorData CameraDepthAI::captureImage(SensorCaptureInfo * info)
{ {
SensorData data; SensorData data;
@@ -740,7 +755,7 @@ SensorData CameraDepthAI::captureImage(SensorCaptureInfo * info)
double stamp = std::chrono::duration<double>(depthOrRight->getTimestampDevice(dai::CameraExposureOffset::MIDDLE).time_since_epoch()).count(); double stamp = std::chrono::duration<double>(depthOrRight->getTimestampDevice(dai::CameraExposureOffset::MIDDLE).time_since_epoch()).count();
if(outputMode_) if(outputMode_)
data = SensorData(cv::imdecode(rgbOrLeft->getData(), cv::IMREAD_ANYCOLOR), depthOrRight->getCvFrame(), stereoModel_.left(), this->getNextSeqID(), stamp); data = SensorData(cv::imdecode(rgbOrLeft->getData(), cv::IMREAD_ANYCOLOR), depthImgFrameToCvMat(depthOrRight), stereoModel_.left(), this->getNextSeqID(), stamp);
else else
data = SensorData(cv::imdecode(rgbOrLeft->getData(), cv::IMREAD_GRAYSCALE), cv::imdecode(depthOrRight->getData(), cv::IMREAD_GRAYSCALE), stereoModel_, this->getNextSeqID(), stamp); data = SensorData(cv::imdecode(rgbOrLeft->getData(), cv::IMREAD_GRAYSCALE), cv::imdecode(depthOrRight->getData(), cv::IMREAD_GRAYSCALE), stereoModel_, this->getNextSeqID(), stamp);
+13
View File
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e671b87..86b590c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,7 +121,7 @@ set( NANOFLANN_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE )
set( NANOFLANN_BUILD_TESTS OFF CACHE BOOL "" FORCE )
add_subdirectory( extern/nanoflann EXCLUDE_FROM_ALL )
target_link_libraries( CCCoreLib
- PUBLIC
+ PRIVATE
nanoflann::nanoflann
)
+22
View File
@@ -0,0 +1,22 @@
diff --git a/freenect2.cmake.in b/freenect2.cmake.in
index 05df1af..2195bb4 100644
--- a/freenect2.cmake.in
+++ b/freenect2.cmake.in
@@ -1,10 +1,15 @@
+# Resolve paths relative to this config file (<prefix>/lib/cmake/freenect2/) so the
+# install tree stays relocatable (e.g. when shipped/unzipped as a prebuilt bundle).
+get_filename_component(_freenect2_prefix "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY)
+get_filename_component(_freenect2_prefix "${_freenect2_prefix}" DIRECTORY)
+get_filename_component(_freenect2_prefix "${_freenect2_prefix}" DIRECTORY)
FIND_LIBRARY(freenect2_LIBRARY freenect2
- PATHS @CMAKE_INSTALL_PREFIX@/lib
+ PATHS "${_freenect2_prefix}/lib"
NO_DEFAULT_PATH
)
SET(freenect2_LIBRARIES ${freenect2_LIBRARY} @LIBFREENECT2_THREADING_LIBRARIES@)
FIND_PATH(freenect2_INCLUDE_DIR @PROJECT_NAME@/libfreenect2.hpp
- PATHS @CMAKE_INSTALL_PREFIX@/include
+ PATHS "${_freenect2_prefix}/include"
NO_DEFAULT_PATH
)
SET(freenect2_INCLUDE_DIRS ${freenect2_INCLUDE_DIR})
+29
View File
@@ -0,0 +1,29 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 261f2cda..644e068f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -92,17 +92,20 @@ if(OB_IS_MAIN_PROJECT)
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/generated/Export.h" DESTINATION include/libobsensor/h)
- install(EXPORT ${OB_SDK_LIB_NAME}Config NAMESPACE ob:: DESTINATION lib)
+ install(EXPORT ${OB_SDK_LIB_NAME}Config NAMESPACE ob:: DESTINATION lib/cmake/${OB_SDK_LIB_NAME})
include(CMakePackageConfigHelpers)
+ # Name the version file <pkg>ConfigVersion.cmake (not <pkg>Version.cmake) and
+ # install it next to the config in lib/cmake/<pkg>, so find_package(OrbbecSDK)
+ # discovers it in config mode and reads its version.
write_basic_package_version_file(
- "${CMAKE_CURRENT_BINARY_DIR}/${OB_SDK_LIB_NAME}Version.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/${OB_SDK_LIB_NAME}ConfigVersion.cmake"
VERSION "${PROJECT_VERSION}"
COMPATIBILITY SameMajorVersion
)
install(
- FILES "${CMAKE_CURRENT_BINARY_DIR}/${OB_SDK_LIB_NAME}Version.cmake"
- DESTINATION lib
+ FILES "${CMAKE_CURRENT_BINARY_DIR}/${OB_SDK_LIB_NAME}ConfigVersion.cmake"
+ DESTINATION lib/cmake/${OB_SDK_LIB_NAME}
)
if(MSVC)
install(FILES $<TARGET_PDB_FILE:${OB_SDK_LIB_NAME}> DESTINATION bin OPTIONAL)
+17
View File
@@ -113,6 +113,17 @@
"kinectsdk2" "kinectsdk2"
] ]
}, },
"libfreenect2-deps": {
"description": "Build libfreenect2's dependencies",
"dependencies": [
"libusb",
"libjpeg-turbo",
{
"name": "pkgconf",
"host": true
}
]
},
"libpointmatcher-deps": { "libpointmatcher-deps": {
"description": "Build libpointmatcher's dependencies", "description": "Build libpointmatcher's dependencies",
"dependencies": [ "dependencies": [
@@ -173,6 +184,12 @@
} }
] ]
}, },
"pdal": {
"description": "Build RTAB-Map with pdal support",
"dependencies": [
"pdal"
]
},
"python": { "python": {
"description": "Build RTAB-Map with python support", "description": "Build RTAB-Map with python support",
"dependencies": [ "dependencies": [