Skip to content

Commit d1844e6

Browse files
Use global cmake macros and fix gcc-10 build (#1527)
1 parent 996f030 commit d1844e6

File tree

46 files changed

+115
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+115
-197
lines changed

ackermann_steering_controller/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(ackermann_steering_controller)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
6-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
7-
-Werror=missing-braces)
8-
endif()
9-
10-
# using this instead of visibility macros
11-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
12-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
# find dependencies
159
set(THIS_PACKAGE_INCLUDE_DEPENDS

ackermann_steering_controller/package.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
<build_depend>generate_parameter_library</build_depend>
2525

26+
<build_depend>ros2_control_cmake</build_depend>
27+
2628
<depend>backward_ros</depend>
2729
<depend>control_msgs</depend>
2830
<depend>controller_interface</depend>
@@ -36,7 +38,6 @@
3638
<test_depend>ament_cmake_gmock</test_depend>
3739
<test_depend>controller_manager</test_depend>
3840
<test_depend>hardware_interface_testing</test_depend>
39-
<test_depend>hardware_interface</test_depend>
4041
<test_depend>ros2_control_test_assets</test_depend>
4142

4243
<export>

admittance_controller/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(admittance_controller)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
6-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
7-
-Werror=missing-braces)
8-
endif()
9-
10-
# using this instead of visibility macros
11-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
12-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
set(THIS_PACKAGE_INCLUDE_DEPENDS
159
angles

admittance_controller/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
<buildtool_depend>ament_cmake</buildtool_depend>
2424

25+
<build_depend>ros2_control_cmake</build_depend>
26+
2527
<depend>angles</depend>
2628
<depend>backward_ros</depend>
2729
<depend>control_msgs</depend>

bicycle_steering_controller/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(bicycle_steering_controller)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
6-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
7-
-Werror=missing-braces)
8-
endif()
9-
10-
# using this instead of visibility macros
11-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
12-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
# find dependencies
159
set(THIS_PACKAGE_INCLUDE_DEPENDS

bicycle_steering_controller/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<buildtool_depend>ament_cmake</buildtool_depend>
2323

2424
<build_depend>generate_parameter_library</build_depend>
25+
<build_depend>ros2_control_cmake</build_depend>
2526

2627
<depend>backward_ros</depend>
2728
<depend>control_msgs</depend>
@@ -35,7 +36,6 @@
3536

3637
<test_depend>ament_cmake_gmock</test_depend>
3738
<test_depend>controller_manager</test_depend>
38-
<test_depend>hardware_interface</test_depend>
3939
<test_depend>hardware_interface_testing</test_depend>
4040
<test_depend>ros2_control_test_assets</test_depend>
4141

diff_drive_controller/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(diff_drive_controller)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable
6-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
7-
-Werror=missing-braces)
8-
endif()
9-
10-
# using this instead of visibility macros
11-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
12-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
set(THIS_PACKAGE_INCLUDE_DEPENDS
159
control_toolbox

diff_drive_controller/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
<author email="[email protected]">Jordan Palacios</author>
2222

2323
<buildtool_depend>ament_cmake</buildtool_depend>
24+
2425
<build_depend>generate_parameter_library</build_depend>
26+
<build_depend>ros2_control_cmake</build_depend>
2527

2628
<depend>backward_ros</depend>
2729
<depend>control_toolbox</depend>

effort_controllers/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(effort_controllers)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
6-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
7-
-Werror=missing-braces)
8-
endif()
9-
10-
# using this instead of visibility macros
11-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
12-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
set(THIS_PACKAGE_INCLUDE_DEPENDS
159
forward_command_controller

effort_controllers/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
<buildtool_depend>ament_cmake</buildtool_depend>
2121

22+
<build_depend>ros2_control_cmake</build_depend>
23+
2224
<depend>backward_ros</depend>
2325
<depend>forward_command_controller</depend>
2426
<depend>pluginlib</depend>

force_torque_sensor_broadcaster/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(force_torque_sensor_broadcaster)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
6-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
7-
-Werror=missing-braces)
8-
endif()
9-
10-
# using this instead of visibility macros
11-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
12-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
set(THIS_PACKAGE_INCLUDE_DEPENDS
159
controller_interface

force_torque_sensor_broadcaster/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
<buildtool_depend>ament_cmake</buildtool_depend>
2323

24+
<build_depend>ros2_control_cmake</build_depend>
25+
2426
<depend>backward_ros</depend>
2527
<depend>controller_interface</depend>
2628
<depend>geometry_msgs</depend>

forward_command_controller/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(forward_command_controller)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
6-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
7-
-Werror=missing-braces)
8-
endif()
9-
10-
# using this instead of visibility macros
11-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
12-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
set(THIS_PACKAGE_INCLUDE_DEPENDS
159
controller_interface

forward_command_controller/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
<buildtool_depend>ament_cmake</buildtool_depend>
2121

22+
<build_depend>ros2_control_cmake</build_depend>
23+
2224
<depend>backward_ros</depend>
2325
<depend>controller_interface</depend>
2426
<depend>generate_parameter_library</depend>

gpio_controllers/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.8)
22
project(gpio_controllers)
33

4-
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
5-
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
6-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
7-
-Werror=missing-braces)
8-
endif()
9-
10-
# using this instead of visibility macros
11-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
12-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
# find dependencies
159
find_package(ament_cmake REQUIRED)

gpio_controllers/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
<buildtool_depend>ament_cmake</buildtool_depend>
2323

24+
<build_depend>ros2_control_cmake</build_depend>
25+
2426
<depend>controller_interface</depend>
2527
<depend>hardware_interface</depend>
2628
<depend>rclcpp</depend>

gripper_controllers/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(gripper_controllers)
33

4-
# using this instead of visibility macros
5-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
6-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
7-
8-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
9-
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
10-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
11-
-Werror=missing-braces)
12-
endif()
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
set(THIS_PACKAGE_INCLUDE_DEPENDS
159
control_msgs

gripper_controllers/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
<buildtool_depend>ament_cmake</buildtool_depend>
2525

26+
<build_depend>ros2_control_cmake</build_depend>
27+
2628
<depend>backward_ros</depend>
2729
<depend>control_msgs</depend>
2830
<depend>control_toolbox</depend>

imu_sensor_broadcaster/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(imu_sensor_broadcaster)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
6-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
7-
-Werror=missing-braces)
8-
endif()
9-
10-
# using this instead of visibility macros
11-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
12-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
set(THIS_PACKAGE_INCLUDE_DEPENDS
159
controller_interface

imu_sensor_broadcaster/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
<buildtool_depend>ament_cmake</buildtool_depend>
2222

23+
<build_depend>ros2_control_cmake</build_depend>
24+
2325
<depend>backward_ros</depend>
2426
<depend>controller_interface</depend>
2527
<depend>generate_parameter_library</depend>

joint_state_broadcaster/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(joint_state_broadcaster)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
6-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
7-
-Werror=missing-braces)
8-
endif()
9-
10-
# using this instead of visibility macros
11-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
12-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
set(THIS_PACKAGE_INCLUDE_DEPENDS
159
builtin_interfaces

joint_state_broadcaster/package.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@
2020

2121
<buildtool_depend>ament_cmake</buildtool_depend>
2222

23+
<build_depend>ros2_control_cmake</build_depend>
24+
2325
<depend>backward_ros</depend>
2426
<depend>builtin_interfaces</depend>
2527
<depend>control_msgs</depend>
2628
<depend>controller_interface</depend>
2729
<depend>generate_parameter_library</depend>
2830
<depend>pluginlib</depend>
2931
<depend>rclcpp_lifecycle</depend>
32+
<depend>rclcpp</depend>
3033
<depend>rcutils</depend>
3134
<depend>realtime_tools</depend>
3235
<depend>sensor_msgs</depend>
@@ -36,7 +39,6 @@
3639
<test_depend>controller_manager</test_depend>
3740
<test_depend>hardware_interface_testing</test_depend>
3841
<test_depend>hardware_interface</test_depend>
39-
<test_depend>rclcpp</test_depend>
4042
<test_depend>ros2_control_test_assets</test_depend>
4143

4244
<export>

joint_trajectory_controller/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(joint_trajectory_controller)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
6-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
7-
-Werror=missing-braces)
8-
endif()
9-
10-
# using this instead of visibility macros
11-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
12-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
set(THIS_PACKAGE_INCLUDE_DEPENDS
159
angles

joint_trajectory_controller/package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
<buildtool_depend>ament_cmake</buildtool_depend>
1919

20+
<build_depend>ros2_control_cmake</build_depend>
21+
2022
<depend>angles</depend>
2123
<depend>backward_ros</depend>
2224
<depend>controller_interface</depend>

mecanum_drive_controller/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(mecanum_drive_controller)
33

4-
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
5-
add_compile_options(-Wall -Wextra -Wpedantic -Werror=conversion -Werror=unused-but-set-variable
6-
-Werror=return-type -Werror=shadow -Werror=format -Werror=range-loop-construct
7-
-Werror=missing-braces)
8-
endif()
9-
10-
# using this instead of visibility macros
11-
# S1 from https://github.com/ros-controls/ros2_controllers/issues/1053
12-
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
4+
find_package(ros2_control_cmake REQUIRED)
5+
set_compiler_options()
6+
export_windows_symbols()
137

148
# find dependencies
159
set(THIS_PACKAGE_INCLUDE_DEPENDS

mecanum_drive_controller/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<buildtool_depend>ament_cmake</buildtool_depend>
2424

2525
<build_depend>generate_parameter_library</build_depend>
26+
<build_depend>ros2_control_cmake</build_depend>
2627

2728
<depend>control_msgs</depend>
2829
<depend>controller_interface</depend>

0 commit comments

Comments
 (0)