-
Notifications
You must be signed in to change notification settings - Fork 21
/
CMakeLists.txt
72 lines (63 loc) · 1.96 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
cmake_minimum_required(VERSION 2.8.3)
project(libhaloc)
# C++11 support
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
find_package(catkin REQUIRED COMPONENTS
roscpp
roslib
tf
cv_bridge
image_geometry
std_msgs
cmake_modules)
# Dependencies - Eigen:
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIRS})
# Dependencies - OpenCV:
find_package(OpenCV REQUIRED)
if (${OpenCV_VERSION} MATCHES "3.3.1")
foreach(__cvcomponent ${OpenCV_LIB_COMPONENTS})
set (__original_cvcomponent ${__cvcomponent})
if(NOT __cvcomponent MATCHES "^opencv_")
set(__cvcomponent opencv_${__cvcomponent})
endif()
if (TARGET ${__cvcomponent})
set_target_properties(${__cvcomponent} PROPERTIES
MAP_IMPORTED_CONFIG_DEBUG ""
MAP_IMPORTED_CONFIG_RELEASE ""
MAP_IMPORTED_CONFIG_RELWITHDEBINFO ""
MAP_IMPORTED_CONFIG_MINSIZEREL ""
)
endif()
endforeach(__cvcomponent)
endif()
include_directories(${OpenCV_INCLUDE_DIRS})
link_directories(${OpenCV_LIBRARY_DIRS})
catkin_package(INCLUDE_DIRS include LIBRARIES haloc)
# Add the Image Hashing library
add_library(haloc
src/hash.cpp
src/publisher.cpp)
target_link_libraries(haloc
${Boost_LIBRARIES}
${EIGEN3_LIBRARIES}
${OpenCV_LIBRARIES}
${catkin_LIBRARIES})
# Include directories
include_directories(${catkin_INCLUDE_DIRS} include)
# Add examples
add_executable(lip6indoor_dataset
examples/lip6indoor_dataset.cpp)
target_link_libraries(lip6indoor_dataset
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
haloc)