-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
104 lines (83 loc) · 2.44 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
cmake_minimum_required(VERSION 2.8.3)
project(vl53l0x_mraa_ros)
find_package(catkin REQUIRED COMPONENTS
message_generation
roscpp
std_msgs
)
## https://answers.ros.org/question/247803/mraa-library-inclusion-in-project/
find_package(PkgConfig REQUIRED)
pkg_check_modules(mraa QUIET mraa)
if(NOT "${mraa_FOUND}")
string(ASCII 27 Esc)
message(WARNING "${Esc}[1;33m mraa is not found. You can only use ROS messages${Esc}[m")
endif()
################################################
## Declare ROS messages, services and actions ##
################################################
add_message_files(
FILES
RangingMeasurementData.msg
RangingMeasurementDataStamped.msg
RangingMeasurementDataStampedArray.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
################################################
## Declare ROS dynamic reconfigure parameters ##
################################################
# XXX
###################################
## catkin specific configuration ##
###################################
if(${mraa_FOUND})
catkin_package(
INCLUDE_DIRS include
LIBRARIES vl53l0x_mraa
CATKIN_DEPENDS message_runtime roscpp std_msgs
DEPENDS mraa
)
else()
catkin_package(
CATKIN_DEPENDS message_runtime roscpp std_msgs
)
endif()
###########
## Build ##
###########
include_directories(
include
${catkin_INCLUDE_DIRS}
${mraa_INCLUDE_DIRS}
)
if(${mraa_FOUND})
## Declare a C++ library
add_library(vl53l0x_mraa
src/vl53l0x_mraa/vl53l0x_mraa.cpp
src/vl53l0x_mraa/core/vl53l0x_api.cpp
src/vl53l0x_mraa/core/vl53l0x_api_calibration.cpp
src/vl53l0x_mraa/core/vl53l0x_api_core.cpp
src/vl53l0x_mraa/core/vl53l0x_api_ranging.cpp
src/vl53l0x_mraa/core/vl53l0x_api_strings.cpp
src/vl53l0x_mraa/platform/vl53l0x_platform.cpp
src/vl53l0x_mraa/platform/vl53l0x_i2c_comms.cpp
)
## Specify libraries to link a library or executable target against
target_link_libraries(vl53l0x_mraa ${mraa_LIBRARIES})
## Declare a C++ executable
add_executable(single_vl53l0x_ros src/single_vl53l0x_ros.cpp)
## Add cmake target dependencies of the executable
add_dependencies(single_vl53l0x_ros ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Specify libraries to link a library or executable target against
target_link_libraries(single_vl53l0x_ros vl53l0x_mraa ${catkin_LIBRARIES})
endif()
#############
## Install ##
#############
# XXX
#############
## Testing ##
#############
# XXX