-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
54 lines (41 loc) · 1.76 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
51
52
53
54
cmake_minimum_required(VERSION 3.4...3.18)
project(pytlbd)
set(CMAKE_CXX_STANDARD 14)
add_subdirectory(pybind11)
###################################### OpenCV ######################################
find_package(OpenCV)
message( STATUS " OpenCV_DIR: " ${OpenCV_DIR})
message( STATUS " OpenCV_INCLUDE_DIRS: " ${OpenCV_INCLUDE_DIRS})
message( STATUS " OpenCV_LIBS: " ${OpenCV_LIBS})
###################################### BLAS & ARPACK ######################################
IF (${WITH_ARPACK})
ADD_DEFINITIONS("-DWITH_ARPACK")
FIND_PACKAGE(BLAS)
MESSAGE(STATUS " BLAS_FOUND: ${BLAS_FOUND}")
MESSAGE(STATUS " BLAS_LIBRARIES: ${BLAS_LIBRARIES}")
INCLUDE_DIRECTORIES(/usr/include/arpack++)
SET(ARPACK_LIBRARIES ${BLAS_LIBRARIES} ${OpenMP_CXX_LIBRARIES} arpack arpack++ superlu)
ENDIF ()
include_directories(${OpenCV_INCLUDE_DIRS})
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
include_directories(src/include)
set( LIB_SOURCES
src/LineBandDescriptor.cpp
src/PairwiseLineMatching.cpp
src/MultiOctaveSegmentDetector.cpp
src/EDLineDetector.cpp
src/MultiScaleMatching.cpp
)
# file(GLOB_RECURSE LIB_SOURCES "src/*.cpp")
add_library(tlbd ${LIB_SOURCES})
# Create the python bindings
pybind11_add_module(pytlbd src/PYAPI.cpp)
# Add the dependency between the LBD code and the bindings
target_link_libraries(pytlbd PRIVATE tlbd ${OpenCV_LIBS} ${ARPACK_LIBRARIES})
target_compile_definitions(pytlbd PRIVATE VERSION_INFO=${EXAMPLE_VERSION_INFO})
add_subdirectory(googletest)
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
enable_testing()
add_executable(test_tlbd tests/test_tlbd.cpp)
target_link_libraries(test_tlbd PRIVATE tlbd ${OpenCV_LIBS} ${ARPACK_LIBRARIES} gtest)
add_test(test_tlbd test_tlbd)