-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
153 lines (129 loc) · 3.01 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
project(ss22_project)
cmake_minimum_required(VERSION 3.0.2)
find_package(robif2b REQUIRED)
find_package(kelo_sdp REQUIRED)
include(GNUInstallDirs)
set(CMAKE_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
add_executable(us1
src/kelo_robile_example_us1.c
)
target_link_libraries(us1
robif2b::kelo
robif2b::ethercat
kelo_sdp::robile_kinematics
m
)
add_executable(us1_act
src/kelo_robile_example_us1_act_whl.c
)
target_link_libraries(us1_act
robif2b::kelo
robif2b::ethercat
kelo_sdp::robile_kinematics
m
)
add_executable(us2
src/kelo_robile_example_us2.c
)
target_link_libraries(us2
robif2b::kelo
robif2b::ethercat
kelo_sdp::robile_kinematics
m
)
add_executable(us3
src/kelo_robile_example_us3.c
)
target_link_libraries(us3
robif2b::kelo
robif2b::ethercat
m
)
add_executable(us4
src/kelo_robile_example_us4.c
)
target_link_libraries(us4
robif2b::kelo
robif2b::ethercat
kelo_sdp::robile_kinematics
m
)
add_executable(us4_act
src/kelo_robile_example_us4_act_whl.c
)
target_link_libraries(us4_act
robif2b::kelo
robif2b::ethercat
kelo_sdp::robile_kinematics
m
)
add_executable(us5
src/kelo_robile_example_us5.c
)
target_link_libraries(us5
robif2b::kelo
robif2b::ethercat
m
)
target_include_directories(us5
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
add_executable(main
src/main.c
src/wheel_aligement.c
src/base_aligement.c
src/ramp.c
)
target_link_libraries(main
robif2b::kelo
robif2b::ethercat
m
)
target_include_directories(main
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
install(
TARGETS us2 us3 us5 main
EXPORT ${PROJECT_NAME}-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# Export this package to CMake's package registry
if(ENABLE_PACKAGE_REGISTRY)
export(PACKAGE ${PROJECT_NAME})
endif()
include(CMakePackageConfigHelpers)
configure_package_config_file(${PROJECT_NAME}-config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_DIR}
)
# Generate the version file for the config file
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake"
VERSION "0.1.0"
COMPATIBILITY AnyNewerVersion
)
# Install cmake configuration and package version
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake"
DESTINATION ${CMAKE_INSTALL_DIR}
)
# Make the targets accessible from this packages's build tree
export(
EXPORT ${PROJECT_NAME}-targets
NAMESPACE ${PROJECT_NAME}::
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-targets.cmake"
)
# Make the targets accessible from this packages's install tree
install(
EXPORT ${PROJECT_NAME}-targets
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_DIR}
)