-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
54 lines (47 loc) · 1.37 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
47
48
49
50
51
52
53
54
cmake_minimum_required(VERSION 3.1.3)
project(hityavie)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_BUILD_TYPE Release)
set(OpenCV_DIR /usr/local/share/OpenCV)
find_package(Eigen3 REQUIRED)
find_package(OpenCV 3 REQUIRED)
find_package(Protobuf REQUIRED)
find_package(Ceres REQUIRED)
find_package(Pangolin REQUIRED)
include_directories(
${PROJECT_SOURCE_DIR}
${EIGEN3_INCLUDE_DIR}
${PROTOBUF_INCLUDE_DIRS}
${CERES_INCLUDE_DIRS}
${Pangolin_INCLUDE_DIRS}
)
exec_program(protoc ARGS "--cpp_out=${PROJECT_SOURCE_DIR}/proto/ --proto_path=${PROJECT_SOURCE_DIR}/proto/ ${PROJECT_SOURCE_DIR}/proto/*.proto")
file(GLOB CAMERA_CC "${PROJECT_SOURCE_DIR}/camera/*.cc")
file(GLOB COMMON_CC "${PROJECT_SOURCE_DIR}/common/*.cc")
file(GLOB IMU_CC "${PROJECT_SOURCE_DIR}/imu/*.cc")
file(GLOB SFM_CC "${PROJECT_SOURCE_DIR}/sfm/*.cc")
file(GLOB OPTIM_CC "${PROJECT_SOURCE_DIR}/optim/*.cc")
file(GLOB PROTO_CC "${PROJECT_SOURCE_DIR}/proto/*.cc")
file(GLOB TRACKER_CC "${PROJECT_SOURCE_DIR}/tracker/*.cc")
file(GLOB YAVIE_CC "${PROJECT_SOURCE_DIR}/yavie/*.cc")
add_library(${PROJECT_NAME} SHARED
${CAMERA_CC}
${COMMON_CC}
${IMU_CC}
${SFM_CC}
${OPTIM_CC}
${PROTO_CC}
${TRACKER_CC}
${YAVIE_CC}
)
target_link_libraries(${PROJECT_NAME}
${EIGEN3_LIBS}
${OpenCV_LIBS}
${PROTOBUF_LIBRARIES}
${CERES_LIBRARIES}
${Pangolin_LIBRARIES}
)
add_executable(Test test.cc)
target_link_libraries(Test
${PROJECT_NAME}
)