Ask Your Question
0

how to detect if xfeatures2d is installed

asked 2018-02-09 10:23:17 -0600

Hej all,

How do I, in the CMakeLists.txt figure out if the current install of openCV has xfeatures2D installed ?

Can I do something along the lines of :

find_package(OpenCV REQUIRED)
if(OPENCV_XFEATURES2D)
    do stuf
endif
edit retag flag offensive close merge delete

Comments

have you try find_package(OpenCV REQUIRED xfeatures2d) ?

LBerger gravatar imageLBerger ( 2018-02-09 10:34:50 -0600 )edit

Nope I haven't but my problem is more that I want to include certain files and certain part of the code only if xfeature2d is found.

malcolmmaya gravatar imagemalcolmmaya ( 2018-02-09 10:36:28 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2018-02-09 11:20:30 -0600

LBerger gravatar image

Ok after some google search I think this code could work

find_package(OpenCV  OPTIONAL_COMPONENTS xfeatures2d) 
if (OPENCV_XFEATURES2D_FOUND)
    message ("xfeature2d found")
else (OPENCV_XFEATURES2D_FOUND)
    message ("no xfeature2d found")
endif (OPENCV_XFEATURES2D_FOUND)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-02-09 10:23:17 -0600

Seen: 269 times

Last updated: Feb 09 '18