Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. # OPENCV package
  2. find_package(OpenCV)
  3. add_library(opencv INTERFACE)
  4. target_include_directories(opencv
  5. INTERFACE
  6. ${OpenCV_INCLUDE_DIRS})
  7. target_link_libraries(opencv
  8. INTERFACE
  9. ${OpenCV_LIBS})
  10.  
  11. add_executable(opencv_example example.cpp)
  12.  
  13. target_link_libraries(opencv_example
  14. PRIVATE
  15. opencv
  16. )
  17.  
  18. # Find OpenCV, you may need to set OpenCV_DIR variable
  19. # to the absolute path to the directory containing OpenCVConfig.cmake file
  20. # via the command line or GUI
  21. find_package(OpenCV REQUIRED)
  22.  
  23. # Declare the executable target built from your sources
  24. add_executable(opencv_example example.cpp)
  25.  
  26. # Link your application with OpenCV libraries
  27. target_link_libraries(opencv_example ${OpenCV_LIBS})
  28.  
  29. ...
  30.  
  31. add_executable(opencv_example example.cpp)
  32.  
  33. target_link_libraries(opencv_example
  34. PRIVATE
  35. opencv::core
  36. opencv::video
  37. opencv::imgproc
  38. )
  39.  
  40. find_package(OpenCV REQUIRED COMPONENTS core imgproc video)
  41.  
  42. add_executable(opencv_example example.cpp)
  43.  
  44. target_link_libraries(opencv_example
  45. PRIVATE
  46. opencv_core
  47. opencv_video
  48. opencv_imgproc
  49. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement