-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
213 lines (190 loc) · 9.3 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
cmake_minimum_required(VERSION 3.5.0)
project(tesseract_ignition VERSION 0.1.0 LANGUAGES CXX)
find_package(Eigen3 REQUIRED)
find_package(tesseract_collision REQUIRED)
find_package(tesseract_common REQUIRED)
find_package(tesseract_environment REQUIRED)
find_package(tesseract_support REQUIRED)
find_package(tesseract_urdf REQUIRED)
find_package(tesseract_visualization REQUIRED)
find_package(tesseract_command_language REQUIRED)
find_package(cmake_common_scripts REQUIRED)
# Find ignition-gui
find_package(ignition-gui4 REQUIRED)
find_package(ignition-common3 COMPONENTS profiler events av REQUIRED)
find_package(ignition-rendering4 REQUIRED)
find_package(ignition-transport8 REQUIRED)
find_package(ignition-msgs5 REQUIRED)
find_package(Qt5 COMPONENTS Core Quick QuickControls2 REQUIRED)
set(COVERAGE_EXCLUDE /usr/* /opt/* ${CMAKE_CURRENT_LIST_DIR}/test/* /*/gtest/*)
add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE})
# Load variable for clang tidy args, compiler options and cxx version
tesseract_variables()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IGNITION-GUI_CXX_FLAGS}")
# Need to add to target when upgraded to newer cmake version
link_directories(
${IGNITION-COMMON_LIBRARY_DIRS}
${IGNITION-GUI_LIBRARY_DIRS}
${IGNITION-RENDERING_LIBRARY_DIRS}
${IGNITION-TRANSPORT_LIBRARY_DIRS}
${IGNITION-MSGS_LIBRARY_DIRS}
)
add_library(${PROJECT_NAME} SHARED src/conversions.cpp src/utils.cpp src/render_utils.cpp)
target_link_libraries(${PROJECT_NAME} PUBLIC
tesseract::tesseract_environment_kdl
tesseract::tesseract_support
tesseract::tesseract_urdf
tesseract::tesseract_visualization_ignition
${IGNITION-COMMON_LIBRARIES}
${IGNITION-RENDERING_LIBRARIES}
${IGNITION-MSGS_LIBRARIES}
Qt5::Core)
target_compile_options(${PROJECT_NAME} PRIVATE ${TESSERACT_COMPILE_OPTIONS})
target_cxx_version(${PROJECT_NAME} PUBLIC VERSION 17)
target_include_directories(${PROJECT_NAME} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
${IGNITION-COMMON_INCLUDE_DIRS}
${IGNITION-RENDERING_INCLUDE_DIRS}
${IGNITION-MSGS_INCLUDE_DIRS})
message(WARNING ${IGNITION-MSGS_INCLUDE_DIRS})
QT5_WRAP_CPP(TesseractScene3D_headers_MOC include/tesseract_ignition/scene3d/tesseract_scene3d.h)
QT5_ADD_RESOURCES(TesseractScene3D_resources_RCC include/tesseract_ignition/scene3d/TesseractScene3D.qrc)
add_library(TesseractScene3D SHARED ${TesseractScene3D_headers_MOC} src/scene3d/tesseract_scene3d.cpp ${TesseractScene3D_resources_RCC})
target_link_libraries(TesseractScene3D PUBLIC
${IGNITION-COMMON_LIBRARIES}
${IGNITION-GUI_LIBRARIES}
${IGNITION-RENDERING_LIBRARIES}
${IGNITION-TRANSPORT_LIBRARIES}
${IGNITION-MSGS_LIBRARIES}
Qt5::Core Qt5::Quick Qt5::QuickControls2 )
target_include_directories(TesseractScene3D PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_include_directories(TesseractScene3D SYSTEM PUBLIC
${IGNITION-GUI_INCLUDE_DIRS}
${IGNITION-COMMON_INCLUDE_DIRS}
${IGNITION-RENDERING_INCLUDE_DIRS}
${IGNITION-TRANSPORT_INCLUDE_DIRS}
${IGNITION-MSGS_INCLUDE_DIRS})
QT5_WRAP_CPP(TesseractGridConfig_headers_MOC include/tesseract_ignition/grid/tesseract_grid_config.h)
QT5_ADD_RESOURCES(TesseractGridConfig_resources_RCC include/tesseract_ignition/grid/TesseractGridConfig.qrc)
add_library(TesseractGridConfig SHARED ${TesseractGridConfig_headers_MOC} src/grid/tesseract_grid_config.cpp ${TesseractGridConfig_resources_RCC})
target_link_libraries(TesseractGridConfig PUBLIC ${IGNITION-COMMON_LIBRARIES} ${IGNITION-GUI_LIBRARIES} ${IGNITION-RENDERING_LIBRARIES} Qt5::Core Qt5::Quick Qt5::QuickControls2 )
target_include_directories(TesseractGridConfig PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_include_directories(TesseractGridConfig SYSTEM PUBLIC
${IGNITION-GUI_INCLUDE_DIRS}
${IGNITION-COMMON_INCLUDE_DIRS}
${IGNITION-RENDERING_INCLUDE_DIRS})
QT5_WRAP_CPP(TesseractSetupWizard_headers_MOC
include/tesseract_ignition/setup_wizard/tesseract_setup_wizard.h
include/tesseract_ignition/setup_wizard/models/joint_list_model.h
include/tesseract_ignition/setup_wizard/models/allowed_collision_matrix_model.h
include/tesseract_ignition/setup_wizard/models/kinematic_groups_model.h
include/tesseract_ignition/setup_wizard/models/user_defined_joint_states_model.h
include/tesseract_ignition/setup_wizard/models/user_defined_tcp_model.h
include/tesseract_ignition/setup_wizard/models/opw_kinematics_model.h)
QT5_ADD_RESOURCES(TesseractSetupWizard_resources_RCC include/tesseract_ignition/setup_wizard/TesseractSetupWizard.qrc)
add_library(TesseractSetupWizard SHARED
${TesseractSetupWizard_headers_MOC}
src/setup_wizard/tesseract_setup_wizard.cpp
src/setup_wizard/models/joint_list_model.cpp
src/setup_wizard/models/allowed_collision_matrix_model.cpp
src/setup_wizard/models/kinematic_groups_model.cpp
src/setup_wizard/models/user_defined_joint_states_model.cpp
src/setup_wizard/models/user_defined_tcp_model.cpp
src/setup_wizard/models/opw_kinematics_model.cpp
${TesseractSetupWizard_resources_RCC})
target_link_libraries(TesseractSetupWizard PUBLIC
${PROJECT_NAME}
tesseract::tesseract_environment_kdl
tesseract::tesseract_support
tesseract::tesseract_urdf
${IGNITION-COMMON_LIBRARIES}
${IGNITION-GUI_LIBRARIES}
${IGNITION-RENDERING_LIBRARIES}
Qt5::Core Qt5::Quick Qt5::QuickControls2 Qt5::Gui)
target_include_directories(TesseractSetupWizard PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_include_directories(TesseractSetupWizard SYSTEM PUBLIC
${IGNITION-GUI_INCLUDE_DIRS}
${IGNITION-COMMON_INCLUDE_DIRS}
${IGNITION-RENDERING_INCLUDE_DIRS})
QT5_WRAP_CPP(TesseractVideoRecorder_headers_MOC include/tesseract_ignition/recorder/tesseract_video_recorder.h)
QT5_ADD_RESOURCES(TesseractVideoRecorder_resources_RCC include/tesseract_ignition/recorder/TesseractVideoRecorder.qrc)
add_library(TesseractVideoRecorder SHARED ${TesseractVideoRecorder_headers_MOC} src/recorder/tesseract_video_recorder.cpp ${TesseractVideoRecorder_resources_RCC})
target_link_libraries(TesseractVideoRecorder PUBLIC
${IGNITION-COMMON_LIBRARIES}
${IGNITION-GUI_LIBRARIES}
${IGNITION-RENDERING_LIBRARIES}
${IGNITION-TRANSPORT_LIBRARIES}
${IGNITION-MSGS_LIBRARIES}
Qt5::Core Qt5::Quick Qt5::QuickControls2 )
target_include_directories(TesseractVideoRecorder PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_include_directories(TesseractVideoRecorder SYSTEM PUBLIC
${IGNITION-GUI_INCLUDE_DIRS}
${IGNITION-COMMON_INCLUDE_DIRS}
${IGNITION-RENDERING_INCLUDE_DIRS}
${IGNITION-TRANSPORT_INCLUDE_DIRS}
${IGNITION-MSGS_INCLUDE_DIRS})
add_executable(tesseract_setup_wizard_app src/tesseract_setup_wizard_app.cpp)
target_link_libraries(tesseract_setup_wizard_app PUBLIC
${PROJECT_NAME}
${IGNITION-COMMON_LIBRARIES}
${IGNITION-GUI_LIBRARIES}
${IGNITION-RENDERING_LIBRARIES}
Qt5::Core Qt5::Quick Qt5::QuickControls2)
target_include_directories(tesseract_setup_wizard_app PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_include_directories(tesseract_setup_wizard_app SYSTEM PUBLIC
${IGNITION-GUI_INCLUDE_DIRS}
${IGNITION-COMMON_INCLUDE_DIRS}
${IGNITION-RENDERING_INCLUDE_DIRS})
target_compile_definitions(tesseract_setup_wizard_app PRIVATE TSW_CONFIG_PATH="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/config/setup_wizard.config")
add_executable(tesseract_visualization_app src/tesseract_visualization_app.cpp)
target_link_libraries(tesseract_visualization_app PUBLIC
${PROJECT_NAME}
${IGNITION-COMMON_LIBRARIES}
${IGNITION-GUI_LIBRARIES}
${IGNITION-RENDERING_LIBRARIES}
Qt5::Core Qt5::Quick Qt5::QuickControls2)
target_include_directories(tesseract_visualization_app PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_include_directories(tesseract_visualization_app SYSTEM PUBLIC
${IGNITION-GUI_INCLUDE_DIRS}
${IGNITION-COMMON_INCLUDE_DIRS}
${IGNITION-RENDERING_INCLUDE_DIRS})
target_compile_definitions(tesseract_visualization_app PRIVATE TSW_CONFIG_PATH="${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/config/visualization.config")
add_executable(demo_dialog src/demo_dialog.cpp)
target_link_libraries(demo_dialog PUBLIC ${IGNITION-COMMON_LIBRARIES} ${IGNITION-GUI_LIBRARIES} ${IGNITION-RENDERING_LIBRARIES} Qt5::Core Qt5::Quick Qt5::QuickControls2)
target_include_directories(demo_dialog PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_include_directories(demo_dialog SYSTEM PUBLIC
${IGNITION-GUI_INCLUDE_DIRS}
${IGNITION-COMMON_INCLUDE_DIRS}
${IGNITION-RENDERING_INCLUDE_DIRS})
configure_package(NAMESPACE tesseract TARGETS
${PROJECT_NAME}
TesseractScene3D
TesseractGridConfig
TesseractVideoRecorder
TesseractSetupWizard
tesseract_setup_wizard_app
tesseract_visualization_app
demo_dialog)
# Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}
DESTINATION include
FILES_MATCHING PATTERN "*.h" PATTERN "*.qml" PATTERN "*.qrc"
PATTERN ".svn" EXCLUDE
)
install(DIRECTORY config/ DESTINATION share/${PROJECT_NAME}/config)