-
Notifications
You must be signed in to change notification settings - Fork 20
/
CMakeLists.txt
53 lines (41 loc) · 1.38 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
cmake_minimum_required(VERSION 3.5.1)
project(driver_stim300)
set(CMAKE_CXX_STANDARD 14)
add_library(stim300_driver_lib
src/driver_stim300.cpp
src/datagram_parser.cpp
src/serial_unix.cpp)
target_include_directories(stim300_driver_lib
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_link_libraries(stim300_driver_lib)
find_package(catkin REQUIRED COMPONENTS
roscpp
sensor_msgs
std_srvs
)
catkin_package(
CATKIN_DEPENDS sensor_msgs std_srvs
)
add_executable(stim300_driver_node src/stim300_driver_node.cpp)
target_include_directories(stim300_driver_node
PRIVATE
${catkin_INCLUDE_DIRS})
target_link_libraries(stim300_driver_node PRIVATE stim300_driver_lib ${catkin_LIBRARIES})
if (CATKIN_ENABLE_TESTING)
catkin_add_gtest(check_datasheet_constanst
test/check_stim300_constants.cpp
src/stim300_constants.h)
target_link_libraries(check_datasheet_constanst ${catkin_LIBRARIES})
endif()
if (CATKIN_ENABLE_TESTING)
catkin_add_gmock(check_driver_stim300
test/check_driver_stim300.cpp
test/mock_serial_driver.h
src/serial_driver.h)
target_link_libraries(check_driver_stim300 stim300_driver_lib ${catkin_LIBRARIES})
endif()