sagoma/CMakeLists.txt

57 lines
1.7 KiB
Text
Raw Normal View History

cmake_minimum_required( VERSION 2.8 )
project( bs_dsp )
2017-01-05 18:35:44 +01:00
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif(NOT CMAKE_BUILD_TYPE)
2017-01-06 04:12:05 +01:00
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
2017-01-07 01:12:05 +01:00
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Werror -pedantic")
2017-01-20 16:33:54 +01:00
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Werror -pedantic -pg")
2017-01-06 04:12:05 +01:00
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -pedantic -D_DEBUG")
2017-01-05 18:35:44 +01:00
# Eigen library
include_directories( "/usr/include/eigen3/" )
2017-01-07 01:09:22 +01:00
# 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} )
2017-01-05 14:00:14 +01:00
else()
message(STATUS "CUDA not found; will skip bs_dsp")
endif (CUDA_FOUND)
2017-01-07 01:09:22 +01:00
# 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")
#CxxTest
find_package(CxxTest)
if(CXXTEST_FOUND)
include_directories(${CXXTEST_INCLUDE_DIR})
enable_testing()
CXXTEST_ADD_TEST(unittest_changecoord TestChangeCoord.cpp TestChangeCoord.h geometry.cpp)
CXXTEST_ADD_TEST(unittest_line TestLine.cpp TestLine.h geometry.cpp)
target_link_libraries(unittest_changecoord ${OpenCV_LIBS})
target_link_libraries(unittest_line ${OpenCV_LIBS})
else()
message(STATUS "Warning: Can't find CxxTest; testing will be disabled")
endif()
2017-01-12 15:15:34 +01:00
add_executable( lines lines.cpp geometry.cpp cvutils.cpp)
target_link_libraries( lines ${OpenCV_LIBS} )
2017-01-07 01:09:22 +01:00
# vim: set et ts=4 sw=4: