-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·46 lines (35 loc) · 1.17 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
44
45
46
# 指定cmake版本
cmake_minimum_required(VERSION 3.3)
# 工程名
project(all_tests)
#cmake的c++设置
# 告知當前使用的是交叉編譯方式,必須配置
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER "gcc")
SET(CMAKE_CXX_COMPILER "g++")
# 设置编译选项
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -Wall -std=c++14 -fPIC -pthread")
SET(CMAKE_BUILD_TYPE Release)
# 运行测试
add_definitions(-DTEST_ENABLE)
# 开启图优化打印与断言
option(ENABLE_LOGGING "Enable logging." ON )
if(ENABLE_LOGGING)
add_definitions(-DGRAPH_ENABLE_LOG)
endif()
# option(ENABLE_ASSERTIONS "Enable assertions." ON )
# if(ENABLE_ASSERTIONS)
# add_definitions(-DGRAPH_ENABLE_ASSERT)
# endif()
# 添加eigen库
find_package(Eigen3 REQUIRED)
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
# 添加opencv库
find_package(OpenCV REQUIRED)
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
# 添加.h文件
include_directories(src src/lib src/vo src/vo/my_own_vo)
file(GLOB_RECURSE ALL_LIBRIRY_SRCS "src/*.c*")
# 执行文件
add_executable(${PROJECT_NAME} ${ALL_LIBRIRY_SRCS})
target_link_libraries(${PROJECT_NAME} ${EIGEN3_LIBRARY} ${OpenCV_LIBS})