Skip to content
Open
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
43 changes: 35 additions & 8 deletions 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -774,9 +774,10 @@ endif()

# jsoncpp
if(USE_SYSTEM_JSONCPP)
# Try JsonCpp::JsonCpp first (vcpkg), then jsoncpp_lib (system)
open3d_find_package_3rdparty_library(3rdparty_jsoncpp
PACKAGE jsoncpp
TARGETS jsoncpp_lib
TARGETS JsonCpp::JsonCpp jsoncpp_lib
)
if(NOT 3rdparty_jsoncpp_FOUND)
set(USE_SYSTEM_JSONCPP OFF)
Expand Down Expand Up @@ -864,9 +865,17 @@ endif()
# - openssl.cmake needs to be included before curl.cmake, for the
# BORINGSSL_ROOT_DIR variable.
if(USE_SYSTEM_CURL)
open3d_pkg_config_3rdparty_library(3rdparty_curl
SEARCH_ARGS libcurl
# Prefer find_package over pkg-config for better vcpkg compatibility
open3d_find_package_3rdparty_library(3rdparty_curl
PACKAGE CURL
TARGETS CURL::libcurl
)
if(NOT 3rdparty_curl_FOUND)
# Fallback to pkg-config if find_package fails
open3d_pkg_config_3rdparty_library(3rdparty_curl
SEARCH_ARGS libcurl
)
endif()
if(NOT 3rdparty_curl_FOUND)
set(USE_SYSTEM_CURL OFF)
endif()
Expand Down Expand Up @@ -1153,10 +1162,20 @@ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_poisson

# Minizip
if(WITH_MINIZIP)
open3d_pkg_config_3rdparty_library(3rdparty_minizip
SEARCH_ARGS minizip
# Prefer find_package over pkg-config for better vcpkg compatibility
open3d_find_package_3rdparty_library(3rdparty_minizip
PACKAGE unofficial-minizip
TARGETS unofficial::minizip::minizip
)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_minizip)
if(NOT 3rdparty_minizip_FOUND)
# Fallback to pkg-config
open3d_pkg_config_3rdparty_library(3rdparty_minizip
SEARCH_ARGS minizip
)
endif()
if(3rdparty_minizip_FOUND)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_minizip)
endif()
endif()

# Googletest
Expand Down Expand Up @@ -1443,9 +1462,17 @@ list(APPEND Open3D_3RDPARTY_HEADER_TARGETS_FROM_SYSTEM Open3D::3rdparty_opengl)
# RPC interface
# zeromq
if(USE_SYSTEM_ZEROMQ)
open3d_pkg_config_3rdparty_library(3rdparty_zeromq SEARCH_ARGS libzmq)
# Prefer find_package over pkg-config for better vcpkg compatibility
open3d_find_package_3rdparty_library(3rdparty_zeromq
PACKAGE ZeroMQ
TARGETS libzmq
)
if(NOT 3rdparty_zeromq_FOUND)
# Fallback to pkg-config if find_package fails
open3d_pkg_config_3rdparty_library(3rdparty_zeromq SEARCH_ARGS libzmq)
endif()
if(NOT 3rdparty_zeromq_FOUND)
set(USE_USE_SYSTEM_ZEROMQ OFF)
set(USE_SYSTEM_ZEROMQ OFF)
endif()
endif()
if(NOT USE_SYSTEM_ZEROMQ)
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Main
- Add vcpkg support for easier dependency management (PR #7386)
- Upgrade stdgpu third-party library to commit d7c07d0.
- Fix performance for non-contiguous NumPy array conversion in pybind vector converters. This change removes restrictive `py::array::c_style` flags and adds a runtime contiguity check, improving Pandas-to-Open3D conversion speed by up to ~50×. (issue #5250)(PR #7343).
- Corrected documentation for Link Open3D in C++ projects (broken links).
Expand Down
47 changes: 47 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ if(APPLE)
endif()
endif()

# Detect vcpkg toolchain for automatic dependency management
set(OPEN3D_USE_VCPKG OFF)
if(DEFINED CMAKE_TOOLCHAIN_FILE)
cmake_path(GET CMAKE_TOOLCHAIN_FILE FILENAME _open3d_toolchain_filename)
if(_open3d_toolchain_filename STREQUAL "vcpkg.cmake")
set(OPEN3D_USE_VCPKG ON)
message(STATUS "Open3D: vcpkg toolchain detected - preferring system dependencies")
endif()
unset(_open3d_toolchain_filename)
endif()

include(CMakeDependentOption)

# Open3D build options
Expand Down Expand Up @@ -140,6 +151,42 @@ option(WITH_MINIZIP "Enable MiniZIP" OFF
# Sensor options
option(BUILD_LIBREALSENSE "Build support for Intel RealSense camera" OFF)
option(USE_SYSTEM_LIBREALSENSE "Use system pre-installed librealsense" OFF)

# When using vcpkg, automatically prefer system dependencies that are available in vcpkg
if(OPEN3D_USE_VCPKG)
# Core dependencies available in vcpkg
set(USE_SYSTEM_ASSIMP ON CACHE BOOL "vcpkg: Use system assimp" FORCE)
set(USE_SYSTEM_EIGEN3 ON CACHE BOOL "vcpkg: Use system eigen3" FORCE)
set(USE_SYSTEM_FMT ON CACHE BOOL "vcpkg: Use system fmt" FORCE)
set(USE_SYSTEM_GLEW ON CACHE BOOL "vcpkg: Use system glew" FORCE)
set(USE_SYSTEM_GLFW ON CACHE BOOL "vcpkg: Use system glfw" FORCE)
set(USE_SYSTEM_JPEG ON CACHE BOOL "vcpkg: Use system jpeg" FORCE)
set(USE_SYSTEM_JSONCPP ON CACHE BOOL "vcpkg: Use system jsoncpp" FORCE)
set(USE_SYSTEM_MSGPACK ON CACHE BOOL "vcpkg: Use system msgpack" FORCE)
set(USE_SYSTEM_NANOFLANN ON CACHE BOOL "vcpkg: Use system nanoflann" FORCE)
set(USE_SYSTEM_PNG ON CACHE BOOL "vcpkg: Use system png" FORCE)
set(USE_SYSTEM_QHULLCPP ON CACHE BOOL "vcpkg: Use system qhull" FORCE)
set(USE_SYSTEM_TBB ON CACHE BOOL "vcpkg: Use system tbb" FORCE)
set(USE_SYSTEM_TINYGLTF ON CACHE BOOL "vcpkg: Use system tinygltf" FORCE)
set(USE_SYSTEM_TINYOBJLOADER ON CACHE BOOL "vcpkg: Use system tinyobjloader" FORCE)
set(USE_SYSTEM_ZEROMQ ON CACHE BOOL "vcpkg: Use system zeromq" FORCE)
set(USE_SYSTEM_OPENSSL ON CACHE BOOL "vcpkg: Use system openssl" FORCE)
set(USE_SYSTEM_CURL ON CACHE BOOL "vcpkg: Use system curl" FORCE)
# Optional dependencies
set(USE_SYSTEM_EMBREE ON CACHE BOOL "vcpkg: Use system embree" FORCE)
set(USE_SYSTEM_GOOGLETEST ON CACHE BOOL "vcpkg: Use system googletest" FORCE)
# Note: These are NOT in vcpkg or have compatibility issues:
# - USE_SYSTEM_FILAMENT: Filament not in vcpkg
# - USE_SYSTEM_VTK: Complex, has many features
# - USE_SYSTEM_CUTLASS: CUDA-specific, not in vcpkg
# - USE_SYSTEM_STDGPU: Not in vcpkg
# - USE_SYSTEM_LIBLZF: Not in vcpkg
# - USE_SYSTEM_IMGUI: Open3D may need specific version/patches
# - USE_SYSTEM_PYBIND11: Not needed when BUILD_PYTHON_MODULE=OFF
# - USE_SYSTEM_BLAS: Platform-specific handling needed
message(STATUS "Open3D: vcpkg mode - enabled USE_SYSTEM_* for vcpkg-available packages")
endif()

option(BUILD_AZURE_KINECT "Build support for Azure Kinect sensor" OFF)

# ML library options
Expand Down
2 changes: 2 additions & 0 deletions cpp/open3d/utility/Download.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#define USE_OPENSSL
#endif

#ifndef CURL_STATICLIB
#define CURL_STATICLIB
#endif

#include <curl/curl.h>
#include <curl/easy.h>
Expand Down
45 changes: 45 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "open3d",
"version-semver": "0.19.0",
"description": "Open3D: A Modern Library for 3D Data Processing",
"homepage": "http://www.open3d.org/",
"license": "MIT",
"supports": "!uwp",
"dependencies": [
"assimp",
"eigen3",
"fmt",
"glew",
"glfw3",
"libjpeg-turbo",
"libpng",
"jsoncpp",
"msgpack",
"nanoflann",
"qhull",
"tbb",
"tinygltf",
"tinyobjloader",
"zeromq",
"cppzmq",
"openssl",
"curl",
"zlib",
"minizip"
],
"features": {
"cuda": {
"description": "Build with CUDA GPU acceleration support",
"supports": "windows | linux"
},
"embree": {
"description": "Build with Intel Embree ray tracing support",
"dependencies": ["embree3"]
},
"tests": {
"description": "Build unit tests",
"dependencies": ["gtest"]
}
}
}
Loading