https://github.com/isl-org/open3d-cmake-find-package
Find pre-installed Open3D package in CMake
https://github.com/isl-org/open3d-cmake-find-package
cmake cpp open3d
Last synced: about 1 year ago
JSON representation
Find pre-installed Open3D package in CMake
- Host: GitHub
- URL: https://github.com/isl-org/open3d-cmake-find-package
- Owner: isl-org
- License: mit
- Archived: true
- Created: 2021-03-06T11:49:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-25T23:01:42.000Z (almost 2 years ago)
- Last Synced: 2024-10-28T00:23:10.502Z (over 1 year ago)
- Topics: cmake, cpp, open3d
- Language: C++
- Homepage:
- Size: 13.7 KB
- Stars: 50
- Watchers: 7
- Forks: 21
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Moved to the Open3D repo
Please see [the main Open3D repo](https://github.com/isl-org/Open3D/tree/main/examples/cmake/open3d-cmake-find-package) for an updated example.
# Find Pre-Installed Open3D Package in CMake
This is one of the two CMake examples showing how to use Open3D in your CMake
project:
* [Find Pre-Installed Open3D Package in CMake](https://github.com/intel-isl/open3d-cmake-find-package)
* [Use Open3D as a CMake External Project](https://github.com/intel-isl/open3d-cmake-external-project)
For more details, check out the [Open3D repo](https://github.com/intel-isl/Open3D) and
[Open3D docs](http://www.open3d.org/docs/release/cpp_project.html).
## Step 1: Compile and install Open3D
Follow the [Open3D compilation guide](http://www.open3d.org/docs/release/compilation.html),
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:
```bash
git clone --recursive https://github.com/intel-isl/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:
```batch
git clone --recursive https://github.com/intel-isl/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`.
## Step 2: Use Open3D in this example project
On Ubuntu/macOS:
```bash
git clone https://github.com/intel-isl/open3d-cmake-find-package.git
cd open3d-cmake-find-package
mkdir build
cd build
cmake -DOpen3D_ROOT=${HOME}/open3d_install ..
make -j 12
./Draw
```
On Windows:
```batch
git clone https://github.com/intel-isl/open3d-cmake-find-package.git
cd open3d-cmake-find-package
mkdir build
cmake -DOpen3D_ROOT=C:\open3d_install ..
cmake --build . --config Release --parallel 12
Release\Draw
```