-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathCMakeLists.txt
103 lines (88 loc) · 2.51 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
# Copyright (2019-2020) Robotics Systems Lab - ETH Zurich:
# Jonas Junger, Johannes Pankert, Fabio Dubois, Lennart Nachtigall,
# Markus Staeuble
#
# This file is part of the elmo_ethercat_sdk.
# The elmo_ethercat_sdk is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The elmo_ethercat_sdk is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the elmo_ethercat_sdk. If not, see <https://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 2.8.3)
project(elmo_ethercat_sdk)
## Set the C++ standard.
set(CMAKE_CXX_STANDARD 14)
## Enable all compiler warnings and treat them as errors.
add_compile_options(-Wall -Wextra -Wpedantic)
## Export compile commands for clang.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CATKIN_PACKAGE_DEPENDENCIES
message_logger
ethercat_sdk_master
)
find_package(catkin REQUIRED
COMPONENTS
${CATKIN_PACKAGE_DEPENDENCIES}
)
find_package(yaml-cpp REQUIRED)
###################################
## catkin specific configuration ##
###################################
catkin_package(
INCLUDE_DIRS
include
LIBRARIES
${PROJECT_NAME}
CATKIN_DEPENDS
${CATKIN_PACKAGE_DEPENDENCIES}
)
###########
## Build ##
###########
include_directories(
include
SYSTEM
${catkin_INCLUDE_DIRS}
)
add_library(${PROJECT_NAME}
src/${PROJECT_NAME}/Elmo.cpp
src/${PROJECT_NAME}/Configuration.cpp
src/${PROJECT_NAME}/ConfigurationParser.cpp
src/${PROJECT_NAME}/Reading.cpp
src/${PROJECT_NAME}/Command.cpp
src/${PROJECT_NAME}/Controlword.cpp
src/${PROJECT_NAME}/Statusword.cpp
src/${PROJECT_NAME}/DriveState.cpp
src/${PROJECT_NAME}/PdoTypeEnum.cpp
)
add_dependencies(
${PROJECT_NAME}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(
${PROJECT_NAME}
${catkin_LIBRARIES}
${YAML_CPP_LIBRARIES}
)
#############
## Install ##
#############
install(
TARGETS
${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(
DIRECTORY
include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)