Last active
August 26, 2017 13:07
-
-
Save atinfinity/7a4bb0ab8333954b6016 to your computer and use it in GitHub Desktop.
OpenCVを使ったプログラムのCMakeサンプル(WITH_CUDA版)
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) | |
# CUDAのライブラリパスを設定 | |
if(CUDA_TOOLKIT_ROOT_DIR) | |
if(CMAKE_SYSTEM_PROCESSOR MATCHES AMD64*|x86_64* OR MSVC64) | |
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib/x64") | |
else() | |
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib/Win32") | |
endif() | |
endif(CUDA_TOOLKIT_ROOT_DIR) | |
# 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プログラムビルド(WITH_CUDA版)