Add vcpkg support for easier dependency management#7386
Open
eclipse0922 wants to merge 1 commit intoisl-org:mainfrom
Open
Add vcpkg support for easier dependency management#7386eclipse0922 wants to merge 1 commit intoisl-org:mainfrom
eclipse0922 wants to merge 1 commit intoisl-org:mainfrom
Conversation
|
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
This PR adds native vcpkg support to Open3D, enabling easier builds with
vcpkg-managed dependencies.
Changes:
- Add vcpkg toolchain auto-detection in CMakeLists.txt
- Auto-enable USE_SYSTEM_* options when vcpkg is detected
- Fix find_package() for vcpkg compatibility:
- jsoncpp: Add JsonCpp::JsonCpp target (vcpkg naming)
- curl: Use find_package(CURL) instead of pkg-config
- zeromq: Use find_package(ZeroMQ) instead of pkg-config
- minizip: Use find_package(unofficial-minizip) instead of pkg-config
- Fix CURL_STATICLIB redefinition warning in Download.cpp
- Add vcpkg.json manifest for dependency specification
- Fix typo: USE_USE_SYSTEM_ZEROMQ -> USE_SYSTEM_ZEROMQ
All changes are backwards compatible - non-vcpkg builds work as before.
Usage with vcpkg:
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DBUILD_PYTHON_MODULE=OFF -DBUILD_GUI=OFF ..
77549fa to
07abfbb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds native vcpkg support to Open3D, enabling easier builds with vcpkg-managed dependencies.
Note: This is Phase 1 of vcpkg support - upstream changes to Open3D's build system. Phase 2 (creating the actual vcpkg port in microsoft/vcpkg) will follow after this PR is merged.
Changes
All changes are backwards compatible - non-vcpkg builds work as before.
Roadmap for Full vcpkg Support
Note: CUDA is supported in Phase 1 - just install CUDA Toolkit separately and use
-DBUILD_CUDA_MODULE=ONType
Motivation and Context
vcpkg is a popular C++ package manager used by many developers, but Open3D has lacked native vcpkg support since 2019 (#767). Previous attempts (microsoft/vcpkg#17423) failed due to pkg-config path issues and missing CMake target compatibility.
This PR enables Open3D to build seamlessly with vcpkg-managed dependencies by:
Checklist:
python util/check_style.py --applyto apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
Changes Made
CMakeLists.txt3rdparty/find_dependencies.cmake3rdparty/stdgpu/stdgpu.cmakecpp/open3d/utility/Download.cppvcpkg.jsonTest Results
Successfully built on Ubuntu 22.04 with vcpkg:
Current Scope (Phase 1)
Dependencies from vcpkg (verified working)
assimp, curl, eigen3, fmt, glew, glfw3, jpeg, jsoncpp, msgpack, nanoflann, openssl, png, qhull, tbb, tinyobjloader, zeromq, cppzmq, minizip
Backwards Compatibility
All changes include fallbacks - non-vcpkg builds work exactly as before.
Next Steps After This PR