-
Notifications
You must be signed in to change notification settings - Fork 44
/
CMakeLists.txt
43 lines (37 loc) · 1.27 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
project(lfv)
cmake_minimum_required(VERSION 2.8)
#TODO: please change the following line to include the Qt5 path
set(CMAKE_PREFIX_PATH $ENV{HOME}/Qt5.7.0/5.7/gcc_64)
macro(use_cxx11)
if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
endif ()
else ()
set (CMAKE_CXX_STANDARD 11)
endif ()
endmacro(use_cxx11)
use_cxx11()
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
#find_package(Qt5OpenGL REQUIRED)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(OpenCV REQUIRED)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
file(GLOB_RECURSE SRCS "src/*.cpp")
file(GLOB_RECURSE HEADERS "src/*.h")
set (INCLUDE_DIRS "")
foreach (_header ${HEADERS})
get_filename_component(_dir ${_header} PATH)
list (APPEND INCLUDE_DIRS ${_dir})
endforeach()
list(REMOVE_DUPLICATES INCLUDE_DIRS)
include_directories(${INCLUDE_DIRS} ${OPENCV_INCLUDE_DIRS})
add_executable(lfv ${SRCS} ${HEADERS})
target_link_libraries(lfv ${OpenCV_LIBS} Qt5::Core Qt5::Widgets)# Qt5::OpenGL)
file(COPY Resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR})