mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-03 16:47:47 +08:00
RTABMapConfig.cmake, guard from including stereoRectifyFisheye.h
This commit is contained in:
@@ -1325,6 +1325,14 @@ install(EXPORT rtabmapTargets
|
||||
####
|
||||
# Setup RTABMapConfig.cmake
|
||||
####
|
||||
# OpenCV split calib3d into "calib"+"geometry" in version 5; record the
|
||||
# components this build used so downstream find_package(RTABMap) requests a
|
||||
# matching set for the same OpenCV major version.
|
||||
IF(OpenCV_VERSION_MAJOR GREATER 4)
|
||||
SET(CONF_OPENCV_COMPONENTS "core calib imgproc highgui stitching photo video geometry")
|
||||
ELSE()
|
||||
SET(CONF_OPENCV_COMPONENTS "core calib3d imgproc highgui stitching photo video")
|
||||
ENDIF()
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
# Mandatory dependencies
|
||||
find_dependency(OpenCV COMPONENTS core calib3d imgproc highgui stitching photo video OPTIONAL_COMPONENTS aruco objdetect xfeatures2d nonfree gpu cudafeatures2d)
|
||||
find_dependency(OpenCV COMPONENTS @CONF_OPENCV_COMPONENTS@ OPTIONAL_COMPONENTS aruco objdetect xfeatures2d nonfree gpu cudafeatures2d)
|
||||
|
||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/RTABMap_guiTargets.cmake")
|
||||
find_dependency(PCL 1.7 COMPONENTS common io kdtree search surface filters registration sample_consensus segmentation visualization)
|
||||
|
||||
@@ -32,6 +32,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef CORELIB_SRC_OPENCV_STEREORECTIFYFISHEYE_H_
|
||||
#define CORELIB_SRC_OPENCV_STEREORECTIFYFISHEYE_H_
|
||||
|
||||
// This header relies on the OpenCV C API (cvRodrigues2, cvProjectPoints2, ...)
|
||||
// which was removed in OpenCV 5. Pull in only the version macros (available in
|
||||
// all OpenCV versions) so we can fail early with a clear message rather than
|
||||
// with cryptic errors from the includes below.
|
||||
#include <opencv2/core/version.hpp>
|
||||
#if CV_MAJOR_VERSION >= 5
|
||||
#error "stereoRectifyFisheye.h is not supported with OpenCV 5 or later (it uses the removed OpenCV C API). Use cv::fisheye::stereoRectify() instead, or guard your include with '#if CV_MAJOR_VERSION < 5'."
|
||||
#endif
|
||||
|
||||
#include <opencv2/calib3d/calib3d.hpp>
|
||||
#if CV_MAJOR_VERSION >= 3
|
||||
#include <opencv2/calib3d/calib3d_c.h>
|
||||
|
||||
Reference in New Issue
Block a user