Skip to content

Commit ecc5774

Browse files
authored
refactor: use autoware cmake (autowarefoundation#849)
* remove autoware_auto_cmake Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * add build_depend of autoware_cmake Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * use autoware_cmake in CMakeLists.txt Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * fix bugs Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * fix cmake lint errors Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
1 parent 263e985 commit ecc5774

File tree

268 files changed

+601
-2450
lines changed

Some content is hidden

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

268 files changed

+601
-2450
lines changed
+2-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cmake_minimum_required(VERSION 3.5)
22
project(autoware_ad_api_msgs)
33

4-
find_package(ament_cmake_auto REQUIRED)
5-
ament_auto_find_build_dependencies()
4+
find_package(autoware_cmake REQUIRED)
5+
autoware_package()
66

77
rosidl_generate_interfaces(${PROJECT_NAME}
88
srv/InterfaceVersion.srv
@@ -12,9 +12,4 @@ rosidl_generate_interfaces(${PROJECT_NAME}
1212
geometry_msgs
1313
)
1414

15-
if(BUILD_TESTING)
16-
find_package(ament_lint_auto REQUIRED)
17-
ament_lint_auto_find_test_dependencies()
18-
endif()
19-
2015
ament_auto_package()

common/autoware_ad_api_msgs/package.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99

1010
<buildtool_depend>ament_cmake_auto</buildtool_depend>
1111

12-
<depend>geometry_msgs</depend>
13-
<depend>std_msgs</depend>
14-
12+
<build_depend>autoware_cmake</build_depend>
1513
<build_depend>builtin_interfaces</build_depend>
1614
<build_depend>rosidl_default_generators</build_depend>
1715

16+
<depend>geometry_msgs</depend>
17+
<depend>std_msgs</depend>
18+
1819
<exec_depend>builtin_interfaces</exec_depend>
1920
<exec_depend>rosidl_default_runtime</exec_depend>
2021

common/autoware_auto_cmake/CMakeLists.txt

-18
This file was deleted.

common/autoware_auto_cmake/autoware_auto_cmake-extras.cmake

-16
This file was deleted.

common/autoware_auto_cmake/cmake/autoware_auto_cmake.cmake

-111
This file was deleted.

common/autoware_auto_cmake/design/autoware_auto_cmake-design.md

-27
This file was deleted.

common/autoware_auto_cmake/package.xml

-29
This file was deleted.
+3-25
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,13 @@
11
cmake_minimum_required(VERSION 3.5)
22
project(autoware_auto_common)
33

4-
## dependencies
5-
find_package(ament_cmake_auto REQUIRED)
6-
find_package(Eigen3 REQUIRED)
7-
ament_auto_find_build_dependencies()
4+
find_package(autoware_cmake REQUIRED)
5+
autoware_package()
86

7+
find_package(Eigen3 REQUIRED)
98
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
109

1110
if(BUILD_TESTING)
12-
find_package(ament_lint_auto REQUIRED)
13-
14-
# Temporarily disable cpplint and uncrustify
15-
list(APPEND AMENT_LINT_AUTO_EXCLUDE
16-
ament_cmake_cpplint
17-
)
18-
19-
ament_lint_auto_find_test_dependencies()
20-
21-
file(GLOB_RECURSE FILES_MINUS_SOME
22-
${CMAKE_CURRENT_SOURCE_DIR}/include/*
23-
${CMAKE_CURRENT_SOURCE_DIR}/test/*
24-
)
25-
26-
# Re-enable cpplint
27-
find_package(ament_cmake_cpplint)
28-
ament_cpplint(${FILES_MINUS_SOME})
29-
30-
# Unit tests
3111
set(TEST_COMMON test_common_gtest)
3212
ament_add_gtest(${TEST_COMMON}
3313
test/gtest_main.cpp
@@ -41,7 +21,6 @@ if(BUILD_TESTING)
4121
test/test_type_name.cpp
4222
test/test_type_traits.cpp
4323
)
44-
autoware_set_compile_options(${TEST_COMMON})
4524
target_compile_options(${TEST_COMMON} PRIVATE -Wno-sign-conversion)
4625
target_include_directories(${TEST_COMMON} PRIVATE include)
4726
ament_target_dependencies(${TEST_COMMON}
@@ -51,5 +30,4 @@ if(BUILD_TESTING)
5130
)
5231
endif()
5332

54-
# Ament Exporting
5533
ament_auto_package()

common/autoware_auto_common/package.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
<license>Apache License 2.0</license>
99

1010
<buildtool_depend>ament_cmake_auto</buildtool_depend>
11-
<buildtool_depend>autoware_auto_cmake</buildtool_depend>
11+
12+
<build_depend>autoware_cmake</build_depend>
1213

1314
<depend>builtin_interfaces</depend>
1415
<depend>eigen</depend>
+2-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
cmake_minimum_required(VERSION 3.5)
22
project(autoware_auto_geometry)
33

4-
## dependencies
5-
find_package(ament_cmake_auto REQUIRED)
6-
ament_auto_find_build_dependencies()
4+
find_package(autoware_cmake REQUIRED)
5+
autoware_package()
76

8-
# includes
97
ament_auto_add_library(${PROJECT_NAME} SHARED
108
include/geometry/spatial_hash.hpp
119
include/geometry/intersection.hpp
1210
include/geometry/spatial_hash_config.hpp
1311
src/spatial_hash.cpp
1412
src/bounding_box.cpp)
15-
autoware_set_compile_options(${PROJECT_NAME})
1613

1714
# workaround to allow deprecated header to build on both galactic and rolling
1815
if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
@@ -22,10 +19,6 @@ if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
2219
endif()
2320

2421
if(BUILD_TESTING)
25-
# run linters
26-
find_package(ament_lint_auto REQUIRED)
27-
ament_lint_auto_find_test_dependencies()
28-
# gtest
2922
set(GEOMETRY_GTEST geometry_gtest)
3023
set(GEOMETRY_SRC test/src/test_geometry.cpp
3124
test/src/test_convex_hull.cpp
@@ -37,7 +30,6 @@ if(BUILD_TESTING)
3730
test/src/test_intersection.cpp
3831
)
3932
ament_add_gtest(${GEOMETRY_GTEST} ${GEOMETRY_SRC})
40-
autoware_set_compile_options(${GEOMETRY_GTEST})
4133
target_compile_options(${GEOMETRY_GTEST} PRIVATE -Wno-conversion -Wno-sign-conversion)
4234
target_include_directories(${GEOMETRY_GTEST} PRIVATE "test/include" "include")
4335
ament_target_dependencies(${GEOMETRY_GTEST}
@@ -50,5 +42,4 @@ if(BUILD_TESTING)
5042
target_link_libraries(${GEOMETRY_GTEST} ${PROJECT_NAME})
5143
endif()
5244

53-
# Ament Exporting
5445
ament_auto_package()

common/autoware_auto_geometry/package.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
<license>Apache License 2.0</license>
99

1010
<buildtool_depend>ament_cmake_auto</buildtool_depend>
11-
<buildtool_depend>autoware_auto_cmake</buildtool_depend>
11+
12+
<build_depend>autoware_cmake</build_depend>
1213

1314
<depend>autoware_auto_common</depend>
1415
<depend>autoware_auto_geometry_msgs</depend>

common/autoware_auto_perception_rviz_plugin/CMakeLists.txt

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
cmake_minimum_required(VERSION 3.5)
22
project(autoware_auto_perception_rviz_plugin)
33

4-
#dependencies
5-
find_package(ament_cmake_auto REQUIRED)
4+
find_package(autoware_cmake REQUIRED)
5+
autoware_package()
6+
67
find_package(Qt5 REQUIRED COMPONENTS Widgets)
7-
ament_auto_find_build_dependencies()
88

99
set(OD_PLUGIN_LIB_SRC
1010
src/object_detection/detected_objects_display.cpp
@@ -56,12 +56,6 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE "OBJECT_DETECTION_PLUGINS_BUI
5656
# Export the plugin to be imported by rviz2
5757
pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)
5858

59-
if(BUILD_TESTING)
60-
# run linters
61-
find_package(ament_lint_auto REQUIRED)
62-
ament_lint_auto_find_test_dependencies()
63-
endif()
64-
6559
ament_auto_package(
6660
INSTALL_TO_SHARE
6761
icons

common/autoware_auto_perception_rviz_plugin/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
<buildtool_depend>ament_cmake</buildtool_depend>
1212

13+
<build_depend>autoware_cmake</build_depend>
1314
<build_depend>qtbase5-dev</build_depend>
1415

1516
<depend>autoware_auto_perception_msgs</depend>

0 commit comments

Comments
 (0)