CMakeLists.txt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. set(the_description "Contributed/Experimental Algorithms for Salient 2D Features Detection")
  2. if(HAVE_CUDA)
  3. ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
  4. endif()
  5. ocv_define_module(xfeatures2d opencv_core opencv_imgproc opencv_features2d opencv_calib3d OPTIONAL opencv_shape opencv_ml opencv_cudaarithm WRAP python java objc)
  6. if(NOT OPENCV_SKIP_FEATURES2D_DOWNLOADING)
  7. include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/download_vgg.cmake)
  8. include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/download_boostdesc.cmake)
  9. set(DOWNLOAD_DIR "${OpenCV_BINARY_DIR}/downloads/xfeatures2d")
  10. download_boost_descriptors("${DOWNLOAD_DIR}" boost_status)
  11. download_vgg_descriptors("${DOWNLOAD_DIR}" vgg_status)
  12. if(boost_status)
  13. ocv_append_source_file_compile_definitions(${CMAKE_CURRENT_SOURCE_DIR}/src/boostdesc.cpp "OPENCV_XFEATURES2D_HAS_BOOST_DATA=1")
  14. else()
  15. message(WARNING "features2d: Boost descriptor implementation is not available due to missing data (download failed: https://github.com/opencv/opencv_contrib/issues/1301)")
  16. endif()
  17. if(vgg_status)
  18. ocv_append_source_file_compile_definitions(${CMAKE_CURRENT_SOURCE_DIR}/src/vgg.cpp "OPENCV_XFEATURES2D_HAS_VGG_DATA=1")
  19. else()
  20. message(WARNING "features2d: VGG descriptor implementation is not available due to missing data (download failed: https://github.com/opencv/opencv_contrib/issues/1301)")
  21. endif()
  22. if(boost_status OR vgg_status)
  23. ocv_module_include_directories("${DOWNLOAD_DIR}")
  24. endif()
  25. endif()
  26. if(TARGET opencv_test_${name})
  27. ocv_target_include_directories(opencv_test_${name} "${OpenCV_SOURCE_DIR}/modules") # use common files from features2d tests
  28. if(boost_status)
  29. ocv_target_compile_definitions(opencv_test_${name} PRIVATE "OPENCV_XFEATURES2D_HAS_BOOST_DATA=1")
  30. endif()
  31. if(vgg_status)
  32. ocv_target_compile_definitions(opencv_test_${name} PRIVATE "OPENCV_XFEATURES2D_HAS_VGG_DATA=1")
  33. endif()
  34. endif()