ClionでOpenCVを使う場合のCMakeListsの書き方

  • 4
    Like
  • 0
    Comment
More than 1 year has passed since last update.

忘れないようにメモ。

CMakeLists.txt
cmake_minimum_required(VERSION 2.8.4)
project(test)

find_package(OpenCV REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(SOURCE_FILES main.cpp)
add_executable(test ${SOURCE_FILES})
target_link_libraries(test ${OpenCV_LIBS})