diff --git a/CMakeLists.txt b/CMakeLists.txt index 184a680de..d3819db63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -302,7 +302,7 @@ option(DEPTHAI_BUILD_TESTS "Build tests" OFF) option(DEPTHAI_BUILD_EXAMPLES "Build examples - Requires OpenCV library to be installed" OFF) option(DEPTHAI_BUILD_DOCS "Build documentation - requires doxygen to be installed" OFF) option(DEPTHAI_OPENCV_SUPPORT "Enable optional OpenCV support" ON) -option(DEPTHAI_PCL_SUPPORT "Enable optional PCL support" ON) +option(DEPTHAI_PCL_SUPPORT "Enable optional PCL support" OFF) option(DEPTHAI_BINARIES_RESOURCE_COMPILE "Compile Depthai device side binaries into library" ON) diff --git a/README.md b/README.md index 4087e2945..cfc74f3d9 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,7 @@ The following environment variables can be set to alter default behavior of the | DEPTHAI_LIBUSB_ANDROID_JAVAVM | JavaVM pointer that is passed to libusb for rootless Android interaction with devices. Interpreted as decimal value of uintptr_t | | DEPTHAI_CRASHDUMP | Directory in which to save the crash dump. | | DEPTHAI_CRASHDUMP_TIMEOUT | Specifies the duration in seconds to wait for device reboot when obtaining a crash dump. Crash dump retrieval disabled if 0. | +| DEPTHAI_PCL_SUPPORT | Enables PCL support. | ## Running tests diff --git a/cmake/depthaiDependencies.cmake b/cmake/depthaiDependencies.cmake index abff1f6f3..9be00b7f6 100644 --- a/cmake/depthaiDependencies.cmake +++ b/cmake/depthaiDependencies.cmake @@ -22,6 +22,9 @@ else() hunter_add_package(Backward) endif() hunter_add_package(libnop) + if(DEPTHAI_PCL_SUPPORT) + hunter_add_package(jsoncpp) + endif() endif() # If library was build as static, find all dependencies @@ -76,13 +79,16 @@ endif() # OpenCV 4 - (optional, quiet always) find_package(OpenCV 4 QUIET CONFIG) - -find_package(jsoncpp QUIET) +if(DEPTHAI_PCL_SUPPORT AND NOT TARGET JsonCpp::JsonCpp) + find_package(jsoncpp) +endif() set(MODULE_TEMP ${CMAKE_MODULE_PATH}) set(PREFIX_TEMP ${CMAKE_PREFIX_PATH}) set(CMAKE_MODULE_PATH ${_DEPTHAI_MODULE_PATH_ORIGINAL}) set(CMAKE_PREFIX_PATH ${_DEPTHAI_PREFIX_PATH_ORIGINAL}) -find_package(PCL QUIET CONFIG COMPONENTS common visualization) +if(DEPTHAI_PCL_SUPPORT) + find_package(PCL CONFIG COMPONENTS common visualization) +endif() set(CMAKE_MODULE_PATH ${MODULE_TEMP}) set(CMAKE_PREFIX_PATH ${PREFIX_TEMP})