examples/cmake/open3d-cmake-find-package/README.md
This is one of the two CMake examples showing how to use Open3D in your CMake project:
For more details, check out the Open3D repo and Open3D docs.
You may download a precompiled binary package (recommended), or compile your own.
Download the pre-compiled Open3D binary package from the Open3D release page. The binary package is available for Ubuntu (with and without CUDA), macOS (Inel and Apple Si), and Windows. You may download a stable release or a development build (devel-main).
Follow the Open3D compilation guide,
compile and install Open3D in your preferred location. You can specify the
installation path with CMAKE_INSTALL_PREFIX and the number of parallel jobs
to speed up compilation.
On Ubuntu/macOS:
git clone https://github.com/isl-org/Open3D.git
cd Open3D
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${HOME}/open3d_install ..
make install -j 12
cd ../..
On Windows:
git clone https://github.com/isl-org/Open3D.git
cd Open3D
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=C:\open3d_install ..
cmake --build . --config Release --parallel 12 --target install
cd ..\..
Note: -DBUILD_SHARED_LIBS=ON is recommended if -DBUILD_CUDA_MODULE=ON.
On Ubuntu/macOS:
cp -ar Open3D/examples/cmake/open3d-cmake-find-package .
cd open3d-cmake-find-package
mkdir build
cd build
cmake -DOpen3D_ROOT=${HOME}/open3d_install ..
make -j 12
./Draw
On Windows:
cp -ar Open3D/examples/cmake/open3d-cmake-find-package .
cd open3d-cmake-find-package
mkdir build
cmake -DOpen3D_ROOT=C:\open3d_install ..
cmake --build . --config Release --parallel 12
Release\Draw