42 lines
1.1 KiB
CMake
42 lines
1.1 KiB
CMake
cmake_minimum_required( VERSION 2.8 )
|
|
project( bs_dsp )
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
endif(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Werror -pedantic")
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -pedantic -D_DEBUG")
|
|
|
|
|
|
|
|
# Eigen library
|
|
include_directories( "/usr/include/eigen3/" )
|
|
|
|
|
|
# CUDA (optional)
|
|
find_package( CUDA )
|
|
if (CUDA_FOUND)
|
|
include( FindCUDA )
|
|
cuda_add_executable( bs_dsp bs_dsp.cu )
|
|
target_link_libraries( bs_dsp ${OpenCV_LIBS} )
|
|
else()
|
|
message(STATUS "CUDA not found; will skip bs_dsp")
|
|
endif (CUDA_FOUND)
|
|
|
|
# OpenCV
|
|
find_package( OpenCV REQUIRED )
|
|
if(OpenCV_VERSION VERSION_LESS "2.4.8")
|
|
message(FATAL_ERROR "ERROR: Can't find OpenCV 2.4.8+")
|
|
endif()
|
|
if(OpenCV_VERSION VERSION_LESS "3.0")
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAS_OPENCV2")
|
|
else()
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAS_OPENCV3")
|
|
endif (OpenCV_VERSION VERSION_LESS "3.0")
|
|
|
|
add_executable( lines lines.cpp geometry.cpp cvutils.cpp)
|
|
target_link_libraries( lines ${OpenCV_LIBS} )
|
|
|
|
# vim: set et ts=4 sw=4:
|