-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathCMakeLists.txt
50 lines (40 loc) · 1.24 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
cmake_minimum_required(VERSION 3.3)
project(loop_hloc)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++14")
#-DEIGEN_USE_MKL_ALL")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g")
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
nav_msgs
camera_models
cv_bridge
roslib
)
# set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
find_package(CUDA)
# set your own libtorch path
set(TORCH_PATH /your/path/to/libtorch/share/cmake/Torch)
if (TORCH_PATH)
message("TORCH_PATH set to: ${TORCH_PATH}")
set(Torch_DIR ${TORCH_PATH})
else ()
message(FATAL_ERROR "Need to specify Torch path, e.g., pytorch/torch/share/cmake/Torch ")
endif ()
find_package(PythonInterp REQUIRED)
find_package(Torch REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Ceres REQUIRED)
find_package(Eigen3)
include_directories(${catkin_INCLUDE_DIRS} ${CERES_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR})
catkin_package()
add_executable(loop_hloc_node
src/pose_graph_node.cpp
src/pose_graph.cpp
src/keyframe.cpp
src/utility/CameraPoseVisualization.cpp
src/hloc/hloc.cpp
src/hloc/hlocDatabase.h
)
target_link_libraries(loop_hloc_node ${catkin_LIBRARIES} ${OpenCV_LIBS} ${CERES_LIBRARIES} ${CUDA_LIBRARIES} ${TORCH_LIBRARIES})