-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
36 lines (27 loc) · 810 Bytes
/
CMakeLists.txt
File metadata and controls
36 lines (27 loc) · 810 Bytes
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
cmake_minimum_required(VERSION 3.22.1)
project(xfeat_cpp)
# Build type:
# - Set to RELEASE to benchmark the code
# - Set to DEBUG to debug the code
set(CMAKE_BUILD_TYPE Debug)
# enable folder organization in IDE
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# for libtorch
set(CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/thirdparty/pytorch/torch")
# find libraries
find_package(Torch REQUIRED)
find_package(OpenCV REQUIRED)
# set compilation flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
include_directories(
${OpenCV_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/thirdparty/
)
set(THIRD_PARTY_LIBS
${OpenCV_LIBS}
${TORCH_LIBRARIES}
)
add_subdirectory(src)
add_subdirectory(examples)