-
Notifications
You must be signed in to change notification settings - Fork 100
/
Copy pathCMakeLists.txt
41 lines (31 loc) · 1.08 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
PROJECT(jpdaf_tracker)
SET(execName jpdaf_tracker)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -O3 -g")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -O3 -g")
find_package(Eigen3 REQUIRED)
find_package(OpenCV REQUIRED)
set(CMAKE_CXX_STANDARD 17)
if (MSVC)
add_definitions(-D_USE_MATH_DEFINES -DNOMINMAX -D_ENABLE_EXTENDED_ALIGNED_STORAGE)
endif(MSVC)
include(CheckIncludeFileCXX)
check_include_file_cxx(filesystem HAVE_FILESYSTEM)
if(HAVE_FILESYSTEM)
add_definitions(-DHAVE_FILESYSTEM)
message("Founded filesystem header")
else(HAVE_FILESYSTEM)
message("Do not found filesystem header")
endif(HAVE_FILESYSTEM)
include_directories( src )
include_directories( ${OpenCV_INCLUDE_DIRS} )
include_directories(${EIGEN3_INCLUDE_DIR})
file(GLOB_RECURSE tracker_SRC "src/*.cpp")
file(GLOB_RECURSE tracker_INC "src/*.h")
add_executable(${execName} ${tracker_SRC} ${tracker_INC})
if (MSVC)
set(LIBS ${OpenCV_LIBS})
else(MSVC)
set(LIBS ${OpenCV_LIBS} stdc++fs)
endif(MSVC)
TARGET_LINK_LIBRARIES(${execName} ${LIBS})