MacOS下Clion 使用OpenCV

MAC 下使用Clion 配置OpenCV

  1. brew install opencv
  2. 在Clion中新建项目, 假设项目名为demo, 在 CMAKELists.txt中编辑

    cmake_minimum_required(VERSION 3.9)
    project(demo)
    
    set(CMAKE_CXX_STANDARD 11)
    
    find_package(OpenCV)
    
    include_directories(${OpenCV_INCLUDE_DIRS})
    
    add_executable(demo main.cpp)
    target_link_libraries(demo ${OpenCV_LIBS})
    

OK