-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindORB_SLAM3.cmake
43 lines (32 loc) · 1.56 KB
/
FindORB_SLAM3.cmake
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
# Try to find ORB_SLAM3
# Set alternative paths to search for using ORB_SLAM3_DIR
# Once done this will define
# You should ensure your ORB_SLAM3 can run correctly
#
# To help the search ORB_SLAM3_ROOT_DIR environment variable as the path to ORB_SLAM3 root folder
# e.g. `set( ORB_SLAM3_ROOT_DIR=~/ORB_SLAM3) `
set(ORB_SLAM3_ROOT_DIR "~/ORB_SLAM3")
# message(${ORB_SLAM3_ROOT_DIR})
# message(${ORB_SLAM3_ROOT_DIR}/include)
# message(${ORB_SLAM3_ROOT_DIR}/Thirdparty/DBoW2/DBoW2)
# Find ORB_SLAM3
find_path(ORB_SLAM3_INCLUDE_DIR NAMES System.h
PATHS ${ORB_SLAM3_ROOT_DIR}/include)
find_library(ORB_SLAM3_LIBRARY NAMES ORB_SLAM3 libORB_SLAM3
PATHS ${ORB_SLAM3_ROOT_DIR}/lib)
# Find built-in DBoW2
find_path(DBoW2_INCLUDE_DIR NAMES Thirdparty/DBoW2/DBoW2/BowVector.h
PATHS ${ORB_SLAM3_ROOT_DIR})
find_library(DBoW2_LIBRARY NAMES DBoW2
PATHS ${ORB_SLAM3_ROOT_DIR}/Thirdparty/DBoW2/lib)
# Find built-in g2o
find_library(g2o_LIBRARY NAMES g2o
PATHS ${ORB_SLAM3_ROOT_DIR}/Thirdparty/g2o/lib)
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set ORB_SLAM3_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(ORB_SLAM3 DEFAULT_MSG
ORB_SLAM3_LIBRARY ORB_SLAM3_INCLUDE_DIR DBoW2_INCLUDE_DIR DBoW2_LIBRARY g2o_LIBRARY)
mark_as_advanced(ORB_SLAM3_INCLUDE_DIR ORB_SLAM3_LIBRARY )
set(ORB_SLAM3_LIBRARIES ${ORB_SLAM3_LIBRARY} ${DBoW2_LIBRARY} ${g2o_LIBRARY})
set(ORB_SLAM3_INCLUDE_DIRS ${ORB_SLAM3_INCLUDE_DIR} ${DBoW2_INCLUDE_DIR})