Skip to content

Commit

Permalink
Detecting OPENCV_ENABLE_NONFREE if set on OpenCV>=3.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Nov 2, 2018
1 parent 8eda6cb commit b96bc2a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,17 @@ SET(CONF_DEPENDENCIES
)
IF(NOT (OPENCV_NONFREE_FOUND OR OPENCV_XFEATURES2D_FOUND))
SET(NONFREE "//")
ENDIF(NOT (OPENCV_NONFREE_FOUND OR OPENCV_XFEATURES2D_FOUND))
ELSEIF(OpenCV_VERSION VERSION_GREATER "3.4.2")
FIND_FILE(OpenCV_MODULES_HPP opencv2/opencv_modules.hpp
PATHS ${OpenCV_INCLUDE_DIRS}
NO_DEFAULT_PATH)
FILE(READ ${OpenCV_MODULES_HPP} TMPTXT)
STRING(FIND "${TMPTXT}" "#define OPENCV_ENABLE_NONFREE" matchres)
IF(${matchres} EQUAL -1)
SET(NONFREE "//")
ENDIF(${matchres} EQUAL -1)
ENDIF()

IF(NOT G2O_FOUND)
SET(G2O "//")
ELSE()
Expand Down

0 comments on commit b96bc2a

Please sign in to comment.