pinning opencv for downstream apps

This commit is contained in:
matlabbe
2026-07-12 20:06:07 -07:00
parent 40925a3200
commit d29d96a09e
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -1347,6 +1347,9 @@ ELSE()
ENDIF()
STRING(REPLACE ";" " " CONF_OPENCV_COMPONENTS "${CONF_OPENCV_COMPONENTS}")
STRING(REPLACE ";" " " CONF_OPENCV_OPTIONAL_COMPONENTS "${CONF_OPENCV_OPTIONAL_COMPONENTS}")
# Pin the OpenCV major version so downstream projects find the same major RTAB-Map was
# built against
SET(CONF_OPENCV_VERSION_MAJOR ${OpenCV_VERSION_MAJOR})
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
+1 -1
View File
@@ -1,7 +1,7 @@
include(CMakeFindDependencyMacro)
# Mandatory dependencies
find_dependency(OpenCV COMPONENTS @CONF_OPENCV_COMPONENTS@ OPTIONAL_COMPONENTS @CONF_OPENCV_OPTIONAL_COMPONENTS@)
find_dependency(OpenCV @CONF_OPENCV_VERSION_MAJOR@ COMPONENTS @CONF_OPENCV_COMPONENTS@ OPTIONAL_COMPONENTS @CONF_OPENCV_OPTIONAL_COMPONENTS@)
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)