-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathCMakeLists.txt
154 lines (127 loc) · 3.87 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
cmake_minimum_required(VERSION 2.8.11)
project(okvis_ros)
find_package(catkin REQUIRED
pcl_conversions
pcl_ros
roscpp
sensor_msgs
image_transport
cv_bridge
dynamic_reconfigure
geometry_msgs
image_geometry
)
# generate dynamic reconfigure stuff
generate_dynamic_reconfigure_options(cfg/Camera.cfg)
catkin_package(
DEPENDS
CATKIN_DEPENDS
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
)
FIND_PACKAGE(Boost COMPONENTS filesystem system REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
find_package(OpenCV 3.0 REQUIRED)
find_package(mynteye QUIET)
find_package(mynteyed QUIET)
if(mynteye_FOUND)
message(STATUS "MYNT-EYE-S-SDK found.")
else()
message(STATUS "MYNT-EYE-S-SDK not found.")
endif()
if(mynteyed_FOUND)
message(STATUS "MYNT-EYE-D-SDK found.")
else()
message(STATUS "MYNT-EYE-D-SDK not found.")
endif()
# Release
set(CMAKE_BUILD_TYPE Release)
message(STATUS "Building with ${CMAKE_BUILD_TYPE}")
# The configure step fails at catkin_package() if this directory
# doesn't exist yet. Create it at configure time!
file(MAKE_DIRECTORY ${CATKIN_DEVEL_PREFIX}/include)
# let's pull in the okvis plain cmake project
set(BUILD_SHARED_LIBS OFF)
add_subdirectory(okvis)
# libvisensor
#list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/okvis/cmake")
#find_package(VISensor)
#if(VISENSORDRIVER_FOUND)
# add_definitions(-DHAVE_LIBVISENSOR)
# message(STATUS "Found libvisensor in ROS interface.")
# include_directories(${VISensorDriver_INCLUDE_DIR})
#else()
# message(WARNING "libvisensor not found")
#endif()
include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}/include
)
# compile the ROS dependent stuff into a library
add_definitions(-fPIC -march=native -Wextra -Winit-self -Woverloaded-virtual
-Wnon-virtual-dtor -Wsign-promo -Wno-long-long -std=c++0x)
add_library(${PROJECT_NAME} STATIC src/Subscriber.cpp
src/Publisher.cpp
src/RosParametersReader.cpp
include/okvis/Subscriber.hpp
include/okvis/Publisher.hpp
include/okvis/RosParametersReader.hpp)
add_dependencies(${PROJECT_NAME} okvis_multisensor_processing)
# make sure configure headers are built before any node using them
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_gencfg)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
okvis_util
okvis_kinematics
okvis_time
okvis_cv
okvis_common
okvis_ceres
okvis_timing
okvis_matcher
okvis_frontend
okvis_multisensor_processing
pthread
)
#if(VISENSORDRIVER_FOUND)
# target_link_libraries(${PROJECT_NAME} ${VISensorDriver_LIBRARY})
#endif()
include_directories(
okvis/okvis_util/include
okvis/okvis_kinematics/include
okvis/okvis_time/include
okvis/okvis_cv/include
okvis/okvis_common/include
okvis/okvis_ceres/include
okvis/okvis_timing/include
okvis/okvis_matcher/include
okvis/okvis_frontend/include
okvis/okvis_multisensor_processing/include
)
add_executable(okvis_node src/okvis_node.cpp )
target_link_libraries(okvis_node ${PROJECT_NAME} )
add_executable(dataset_convertor src/dataset_convertor.cpp)
target_link_libraries(dataset_convertor ${PROJECT_NAME} )
# SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/../bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
if(mynteye_FOUND)
add_executable(okvis_app_mynteye_s okvis/okvis_apps/src/okvis_app_mynteye.cpp)
target_link_libraries(okvis_app_mynteye_s
okvis_util
okvis_kinematics
okvis_time
okvis_cv
okvis_common
okvis_ceres
okvis_timing
okvis_matcher
okvis_frontend
okvis_multisensor_processing
pthread
mynteye
${Boost_LIBRARIES}
)
endif()
add_executable(okvis_node_synchronous src/okvis_node_synchronous.cpp)
target_link_libraries(okvis_node_synchronous ${PROJECT_NAME} )