Skip to content

Commit 13af896

Browse files
committed
Test available non-free algorithms (KinFu)
1 parent 0db0f1d commit 13af896

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

programs/sceneReconstruction/CMakeLists.txt

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1+
include(CheckCXXSymbolExists)
2+
set(CMAKE_REQUIRED_INCLUDES "${OpenCV_INCLUDE_DIRS}")
3+
set(CMAKE_REQUIRED_QUIET TRUE)
4+
check_cxx_symbol_exists(OPENCV_ENABLE_NONFREE opencv2/opencv_modules.hpp _opencv_nonfree)
5+
16
if(NOT DEFINED ENABLE_sceneReconstruction OR ENABLE_sceneReconstruction)
2-
if(NOT TARGET opencv_rgbd OR NOT OpenCV_VERSION VERSION_GREATER_EQUAL 4.0)
3-
message(WARNING "OpenCV 4.0+/rgbd module not found, disabling sceneReconstruction program")
7+
if(NOT TARGET opencv_rgbd OR NOT OpenCV_VERSION VERSION_GREATER_EQUAL 4.0 OR NOT _opencv_nonfree)
8+
message(WARNING "OpenCV 4.0+/rgbd module with non-free algorithms not found, disabling sceneReconstruction program")
49
elseif(NOT YARP_cv_FOUND)
510
message(WARNING "YARP_cv package not found, disabling sceneReconstruction program")
611
endif()
712
endif()
813

914
cmake_dependent_option(ENABLE_sceneReconstruction "Enable/disable sceneReconstruction program" ON
10-
"TARGET opencv_rgbd;OpenCV_VERSION VERSION_GREATER_EQUAL 4.0;YARP_cv_FOUND" OFF)
15+
"TARGET opencv_rgbd;OpenCV_VERSION VERSION_GREATER_EQUAL 4.0;_opencv_nonfree;YARP_cv_FOUND" OFF)
1116

1217
if(ENABLE_sceneReconstruction)
1318

0 commit comments

Comments
 (0)