-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
61 lines (51 loc) · 1.95 KB
/
CMakeLists.txt
File metadata and controls
61 lines (51 loc) · 1.95 KB
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
cmake_minimum_required(VERSION 2.8.12)
project(DBoW3Py)
add_subdirectory(pybind11)
# ----------------------------------------------------------------------------
# Find Dependencies -- opencv
# ----------------------------------------------------------------------------
find_package(OpenCV 4 REQUIRED)
IF (USE_CONTRIB)
add_definitions(-DUSE_CONTRIB)
ENDIF ()
if (NOT OpenCV_VERSION VERSION_LESS "3.0")
ADD_DEFINITIONS(-DOPENCV_VERSION_3)
SET(OPENCV_VERSION_3 ON)
ELSE ()
SET(OPENCV_VERSION_3 OFF)
ENDIF ()
include_directories(${OpenCV_INCLUDE_DIRS})
SET(REQUIRED_LIBRARIES ${REQUIRED_LIBRARIES} ${OpenCV_LIBS})
# ----------------------------------------------------------------------------
# Find Dependencies -- python numpy
# ----------------------------------------------------------------------------
#find_package(PythonLibs 3 REQUIRED)
#include_directories(${PYTHON_INCLUDE_DIRS})
#SET(REQUIRED_LIBRARIES ${PYTHON_LIBRARIES})
include(Cmake/FindNumPy.cmake)
include_directories(${PYTHON_NUMPY_INCLUDE_DIR})
# ----------------------------------------------------------------------------
# Find Dependencies -- DBoW3
# ----------------------------------------------------------------------------
#find_package(DBoW3 REQUIRED)
#include_directories(${DBoW3_INCLUDE_DIRS})
#SET(REQUIRED_LIBRARIES ${REQUIRED_LIBRARIES} ${DBoW3_LIBS})
set(CMAKE_MACOSX_RPATH 1)
add_subdirectory(DBoW3)
include_directories(DBoW3/include)
SET(REQUIRED_LIBRARIES DBoW3)
# ----------------------------------------------------------------------------
# source
# ----------------------------------------------------------------------------
#SET(SOURCE
# xxx.cpp
# )
SET(SOURCE_PYBIND
${PROJECT_SOURCE_DIR}/src/pydbow3.cpp
${PROJECT_SOURCE_DIR}/src/ndarray_converter.cpp
)
include_directories(
${PROJECT_SOURCE_DIR}/src/
)
pybind11_add_module(DBoW3Py ${SOURCES} ${SOURCE_PYBIND})
target_link_libraries(DBoW3Py PRIVATE ${REQUIRED_LIBRARIES})