orb_slam3_details/Thirdparty/DBoW2/CMakeLists.txt

47 lines
1.1 KiB
CMake
Raw Normal View History

2020-12-01 11:58:17 +08:00
cmake_minimum_required(VERSION 2.8)
project(DBoW2)
2022-03-28 21:20:28 +08:00
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
2020-12-01 11:58:17 +08:00
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -march=native ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -march=native")
set(HDRS_DBOW2
DBoW2/BowVector.h
DBoW2/FORB.h
DBoW2/FClass.h
DBoW2/FeatureVector.h
DBoW2/ScoringObject.h
DBoW2/TemplatedVocabulary.h)
set(SRCS_DBOW2
DBoW2/BowVector.cpp
DBoW2/FORB.cpp
DBoW2/FeatureVector.cpp
DBoW2/ScoringObject.cpp)
set(HDRS_DUTILS
DUtils/Random.h
DUtils/Timestamp.h)
set(SRCS_DUTILS
DUtils/Random.cpp
DUtils/Timestamp.cpp)
2022-04-25 23:28:43 +08:00
# 要保证整个工程的opencv版本一致包括dbow源码以及ros相关的
# 3 4 都可以正常运行
find_package(OpenCV 3.2 QUIET)
2020-12-01 11:58:17 +08:00
if(NOT OpenCV_FOUND)
2021-08-09 19:34:51 +08:00
find_package(OpenCV 3.0 QUIET)
2020-12-01 11:58:17 +08:00
if(NOT OpenCV_FOUND)
2021-08-09 19:34:51 +08:00
message(FATAL_ERROR "OpenCV > 3.0 not found.")
2020-12-01 11:58:17 +08:00
endif()
endif()
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
include_directories(${OpenCV_INCLUDE_DIRS})
add_library(DBoW2 SHARED ${SRCS_DBOW2} ${SRCS_DUTILS})
target_link_libraries(DBoW2 ${OpenCV_LIBS})