-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists.txt
110 lines (88 loc) · 3.21 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
cmake_minimum_required(VERSION 3.5)
project(VISMA)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -Wall -g -fopenmp -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-narrowing")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin )
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib )
# MACROS eigen
add_definitions(-DEIGEN_INITIALIZE_MATRICES_BY_ZERO)
add_definitions(-DEIGEN_DEFAULT_TO_ROW_MAJOR)
# Eigen
find_package(Eigen3 REQUIRED)
# Google log
find_package(Glog REQUIRED)
# Protobuf
find_package(Protobuf REQUIRED)
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROJECT_SOURCE_DIR}/protocols/vlslam.proto)
add_subdirectory(thirdparty/abseil-cpp)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/core
${PROJECT_SOURCE_DIR}/render
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/thirdparty/libigl/include
${PROJECT_SOURCE_DIR}/thirdparty/jsoncpp/include
${PROJECT_SOURCE_DIR}/thirdparty/abseil-cpp
${EIGEN3_INCLUDE_DIR}
${PROTOBUF_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
)
message(STATUS "Found Eigen at ${EIGEN3_INCLUDE_DIR}")
link_directories(
${PROJECT_SOURCE_DIR}/lib
${PROJECT_SOURCE_DIR}/thirdparty/jsoncpp/lib
/usr/local/lib
/usr/lib
/usr/x86_64-linux-gnu
)
link_libraries(
protobuf
glog
jsoncpp
opencv_highgui
opencv_core
opencv_imgproc
opencv_video
opencv_calib3d)
add_library(core SHARED
core/utils.cpp
${PROTO_SRCS})
add_library(visma SHARED
src/dataloader.cpp
src/undistorter.cpp
${PROTO_SRCS})
link_libraries(core visma absl::str_format)
add_executable(example_load example/example_load.cpp)
# target_link_libraries(example_load visma core)
add_executable(example_dump example/example_dump.cpp)
# target_link_libraries(example_dump visma core)
add_executable(undistort_images example/undistort_images.cpp)
# target_link_libraries(undistort_images visma core)
add_executable(generate_depthmaps example/generate_depthmaps.cpp)
# target_link_libraries(generate_depthmaps visma core)
set(BUILD_CORE_TESTS False)
if (${build_core_tests})
add_executable(test_rodrigues core/test/test_rodrigues.cpp)
target_link_libraries(test_rodrigues gtest gtest_main)
# add_executable(test_se3 core/test_se3.cpp)
endif(${build_core_tests})
set(BUILD_EVALUATION False)
if (${build_evaluation})
include_directories(
${PROJECT_SOURCE_DIR}/thirdparty/Open3D/include/Open3D)
link_directories(
${PROJECT_SOURCE_DIR}/thirdparty/Open3D/lib
)
add_library(visma_eval SHARED
src/constrained_ICP.cpp
src/evaluation.cpp
src/visualization.cpp)
target_link_libraries(visma_eval ${PROJECT_SOURCE_DIR}/thirdparty/jsoncpp/lib/libjsoncpp.so)
add_executable(example_evaluate example/example_evaluate.cpp)
target_link_libraries(example_evaluate visma_eval visma core Open3D)
endif(${build_evaluation})
set(build_tools True)
if (${build_tools})
add_subdirectory(render)
endif(${build_tools})