Last active
February 19, 2021 13:51
-
-
Save atinfinity/d9e244e957113f01b85b to your computer and use it in GitHub Desktop.
OpenCVを使ったプログラムのCMakeサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CMakeの最低バージョンを記述 | |
cmake_minimum_required(VERSION 2.8) | |
# ソリューション名を指定 | |
project(SampleSolution) | |
# OpenCVのパッケージを探す | |
find_package(OpenCV REQUIRED) | |
# OpenCVが見つかった場合のみ設定を行う | |
if(OpenCV_FOUND) | |
# インクルードパスを指定(※この例ではOpenCVのみ) | |
include_directories(${OpenCV_INCLUDE_DIRS}) | |
# 実行ファイル名とソース指定 | |
add_executable(SampleProject main.cpp) | |
# リンクするライブラリ指定(※この例ではOpenCVのみ) | |
target_link_libraries(SampleProject ${OpenCV_LIBS}) | |
endif(OpenCV_FOUND) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CMakeを使ったOpenCVプログラムビルド