-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
98 lines (84 loc) · 3.58 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
cmake_minimum_required(VERSION 3.15.0)
# Extract package name and version
find_package(ros_industrial_cmake_boilerplate REQUIRED)
extract_package_metadata(pkg)
project(${pkg_extracted_name} VERSION ${pkg_extracted_version} LANGUAGES CXX)
if(WIN32)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
# All of these are used by all components so to avoid having them in each they are include here
find_package(Eigen3 REQUIRED)
find_package(console_bridge REQUIRED)
find_package(tesseract_scene_graph REQUIRED)
find_package(tesseract_state_solver REQUIRED)
find_package(tesseract_common REQUIRED)
if(NOT TARGET console_bridge::console_bridge)
add_library(console_bridge::console_bridge INTERFACE IMPORTED)
set_target_properties(console_bridge::console_bridge PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
${console_bridge_INCLUDE_DIRS})
set_target_properties(console_bridge::console_bridge PROPERTIES INTERFACE_LINK_LIBRARIES ${console_bridge_LIBRARIES})
else()
get_target_property(CHECK_INCLUDE_DIRECTORIES console_bridge::console_bridge INTERFACE_INCLUDE_DIRECTORIES)
if(NOT ${CHECK_INCLUDE_DIRECTORIES})
set_target_properties(console_bridge::console_bridge PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
${console_bridge_INCLUDE_DIRS})
endif()
endif()
# Load variable for clang tidy args, compiler options and cxx version
tesseract_variables()
initialize_code_coverage(ENABLE ${TESSERACT_ENABLE_CODE_COVERAGE})
set(COVERAGE_EXCLUDE
/usr/*
/opt/*
${CMAKE_CURRENT_LIST_DIR}/test/*
/*/gtest/*
/*/bullet/LinearMath/*)
add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_CODE_COVERAGE})
# Define compile-time default variables
if(MSVC)
set(TESSERACT_KINEMATICS_PLUGIN_PATH ${CMAKE_INSTALL_PREFIX}/bin)
else()
set(TESSERACT_KINEMATICS_PLUGIN_PATH ${CMAKE_INSTALL_PREFIX}/lib)
endif()
# Variable for kinematics plugins
set(KINEMATICS_PLUGINS "")
# Trac-IK
option(TESSERACT_BUILD_TRACIK "Build Trac-IK components" ON)
if(TESSERACT_BUILD_TRACIK)
message("Building Trac-IK components")
list(APPEND SUPPORTED_COMPONENTS trac-ik)
add_subdirectory(tesseract_kinematics/trac-ik)
endif()
# Add compiler definition to core so it can find all plugins produced
string(
REPLACE ";"
":"
KINEMATICS_PLUGINS_STRING
"${KINEMATICS_PLUGINS}")
target_compile_definitions(${PROJECT_NAME}_trac-ik PRIVATE TESSERACT_KINEMATICS_PLUGINS="${KINEMATICS_PLUGINS_STRING}")
# Testing
if((TESSERACT_ENABLE_TESTING OR TESSERACT_KINEMATICS_ENABLE_TESTING)
AND TESSERACT_BUILD_TRACIK)
enable_testing()
add_run_tests_target(ENABLE ${TESSERACT_ENABLE_RUN_TESTING})
add_subdirectory(test)
endif()
configure_package(COMPONENT trac-ik SUPPORTED_COMPONENTS ${SUPPORTED_COMPONENTS})
if(TESSERACT_PACKAGE)
cpack_component_package(
VERSION ${pkg_extracted_version}
MAINTAINER_NAME ${pkg_extracted_maintainer_name}
MAINTAINER_EMAIL ${pkg_extracted_maintainer_email}
DESCRIPTION ${pkg_extracted_description}
LICENSE_FILE ${CMAKE_CURRENT_LIST_DIR}/../LICENSE
README_FILE ${CMAKE_CURRENT_LIST_DIR}/../README.md
COMPONENT_DEPENDS ${SUPPORTED_COMPONENTS})
if(UNIX AND TESSERACT_PACKAGE_SOURCE)
cpack_debian_source_package(
CHANGLELOG ${CMAKE_CURRENT_LIST_DIR}/CHANGELOG.rst
UPLOAD ${TESSERACT_PACKAGE_SOURCE_UPLOAD}
DPUT_HOST ${TESSERACT_PACKAGE_SOURCE_DPUT_HOST}
DEBIAN_INCREMENT ${TESSERACT_PACKAGE_SOURCE_DEBIAN_INCREMENT}
DISTRIBUTIONS ${TESSERACT_PACKAGE_SOURCE_DISTRIBUTIONS})
endif()
endif()