forked from astuff/pacmod3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
87 lines (71 loc) · 1.72 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
cmake_minimum_required(VERSION 2.8.3)
project(pacmod4)
add_definitions(-std=c++14)
# For static library
add_compile_options(-fPIC)
set(catkin_deps
nodelet
roscpp
std_msgs
pacmod4_msgs
can_msgs
)
find_package(catkin REQUIRED ${catkin_deps} roslint)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS ${catkin_deps}
LIBRARIES ${PROJECT_NAME}_nodelet
)
###########
## Build ##
###########
include_directories(
include
pacmod4_common/include
${catkin_INCLUDE_DIRS}
)
# Common Library
add_compile_definitions(ROS_VERSION=$ENV{ROS_VERSION})
add_library(pacmod4_common STATIC
pacmod4_common/src/pacmod4_dbc_ros_api.cpp
pacmod4_common/src/pacmod4_dbc13_ros_api.cpp
pacmod4_common/src/autogen/pacmod13.c
)
# nodelets
add_library(${PROJECT_NAME}_nodelet
src/pacmod4_nodelet.cpp
src/pacmod4_ros_msg_handler.cpp
)
target_link_libraries(${PROJECT_NAME}_nodelet
pacmod4_common
${catkin_LIBRARIES}
)
# nodes
add_executable(${PROJECT_NAME}_node
src/pacmod4_node.cpp
)
target_link_libraries(${PROJECT_NAME}_node
${catkin_LIBRARIES}
)
# TODO: Re-enable after auto-formatting
# set(ROSLINT_CPP_OPTS "--filter=-build/include_subdir")
# roslint_cpp(
# src/pacmod4_node.cpp
# src/pacmod4_nodelet.cpp
# src/pacmod4_ros_msg_handler.cpp
# include/pacmod4/pacmod3_nodelet.h
# include/pacmod4/pacmod3_ros_msg_handler.h
# )
install(TARGETS
${PROJECT_NAME}_node
${PROJECT_NAME}_nodelet
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(FILES nodelets.xml README.md
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)