Skip to content

Commit

Permalink
refactor: use autoware cmake (tier4#849)
Browse files Browse the repository at this point in the history
* remove autoware_auto_cmake

Signed-off-by: Kenji Miyake <[email protected]>

* add build_depend of autoware_cmake

Signed-off-by: Kenji Miyake <[email protected]>

* use autoware_cmake in CMakeLists.txt

Signed-off-by: Kenji Miyake <[email protected]>

* fix bugs

Signed-off-by: Kenji Miyake <[email protected]>

* fix cmake lint errors

Signed-off-by: Kenji Miyake <[email protected]>
  • Loading branch information
kenji-miyake authored and boyali committed Oct 19, 2022
1 parent df6ddb2 commit 1dc920a
Show file tree
Hide file tree
Showing 268 changed files with 618 additions and 2,478 deletions.
9 changes: 2 additions & 7 deletions common/autoware_ad_api_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.5)
project(autoware_ad_api_msgs)

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
find_package(autoware_cmake REQUIRED)
autoware_package()

rosidl_generate_interfaces(${PROJECT_NAME}
srv/InterfaceVersion.srv
Expand All @@ -12,9 +12,4 @@ rosidl_generate_interfaces(${PROJECT_NAME}
geometry_msgs
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_auto_package()
7 changes: 4 additions & 3 deletions common/autoware_ad_api_msgs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@

<buildtool_depend>ament_cmake_auto</buildtool_depend>

<depend>geometry_msgs</depend>
<depend>std_msgs</depend>

<build_depend>autoware_cmake</build_depend>
<build_depend>builtin_interfaces</build_depend>
<build_depend>rosidl_default_generators</build_depend>

<depend>geometry_msgs</depend>
<depend>std_msgs</depend>

<exec_depend>builtin_interfaces</exec_depend>
<exec_depend>rosidl_default_runtime</exec_depend>

Expand Down
18 changes: 0 additions & 18 deletions common/autoware_auto_cmake/CMakeLists.txt

This file was deleted.

16 changes: 0 additions & 16 deletions common/autoware_auto_cmake/autoware_auto_cmake-extras.cmake

This file was deleted.

111 changes: 0 additions & 111 deletions common/autoware_auto_cmake/cmake/autoware_auto_cmake.cmake

This file was deleted.

27 changes: 0 additions & 27 deletions common/autoware_auto_cmake/design/autoware_auto_cmake-design.md

This file was deleted.

29 changes: 0 additions & 29 deletions common/autoware_auto_cmake/package.xml

This file was deleted.

28 changes: 3 additions & 25 deletions common/autoware_auto_common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
cmake_minimum_required(VERSION 3.5)
project(autoware_auto_common)

## dependencies
find_package(ament_cmake_auto REQUIRED)
find_package(Eigen3 REQUIRED)
ament_auto_find_build_dependencies()
find_package(autoware_cmake REQUIRED)
autoware_package()

find_package(Eigen3 REQUIRED)
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)

# Temporarily disable cpplint and uncrustify
list(APPEND AMENT_LINT_AUTO_EXCLUDE
ament_cmake_cpplint
)

ament_lint_auto_find_test_dependencies()

file(GLOB_RECURSE FILES_MINUS_SOME
${CMAKE_CURRENT_SOURCE_DIR}/include/*
${CMAKE_CURRENT_SOURCE_DIR}/test/*
)

# Re-enable cpplint
find_package(ament_cmake_cpplint)
ament_cpplint(${FILES_MINUS_SOME})

# Unit tests
set(TEST_COMMON test_common_gtest)
ament_add_gtest(${TEST_COMMON}
test/gtest_main.cpp
Expand All @@ -41,7 +21,6 @@ if(BUILD_TESTING)
test/test_type_name.cpp
test/test_type_traits.cpp
)
autoware_set_compile_options(${TEST_COMMON})
target_compile_options(${TEST_COMMON} PRIVATE -Wno-sign-conversion)
target_include_directories(${TEST_COMMON} PRIVATE include)
ament_target_dependencies(${TEST_COMMON}
Expand All @@ -51,5 +30,4 @@ if(BUILD_TESTING)
)
endif()

# Ament Exporting
ament_auto_package()
3 changes: 2 additions & 1 deletion common/autoware_auto_common/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_auto_cmake</buildtool_depend>

<build_depend>autoware_cmake</build_depend>

<depend>builtin_interfaces</depend>
<depend>eigen</depend>
Expand Down
13 changes: 2 additions & 11 deletions common/autoware_auto_geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
cmake_minimum_required(VERSION 3.5)
project(autoware_auto_geometry)

## dependencies
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
find_package(autoware_cmake REQUIRED)
autoware_package()

# includes
ament_auto_add_library(${PROJECT_NAME} SHARED
include/geometry/spatial_hash.hpp
include/geometry/intersection.hpp
include/geometry/spatial_hash_config.hpp
src/spatial_hash.cpp
src/bounding_box.cpp)
autoware_set_compile_options(${PROJECT_NAME})

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

if(BUILD_TESTING)
# run linters
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
# gtest
set(GEOMETRY_GTEST geometry_gtest)
set(GEOMETRY_SRC test/src/test_geometry.cpp
test/src/test_convex_hull.cpp
Expand All @@ -37,7 +30,6 @@ if(BUILD_TESTING)
test/src/test_intersection.cpp
)
ament_add_gtest(${GEOMETRY_GTEST} ${GEOMETRY_SRC})
autoware_set_compile_options(${GEOMETRY_GTEST})
target_compile_options(${GEOMETRY_GTEST} PRIVATE -Wno-conversion -Wno-sign-conversion)
target_include_directories(${GEOMETRY_GTEST} PRIVATE "test/include" "include")
ament_target_dependencies(${GEOMETRY_GTEST}
Expand All @@ -50,5 +42,4 @@ if(BUILD_TESTING)
target_link_libraries(${GEOMETRY_GTEST} ${PROJECT_NAME})
endif()

# Ament Exporting
ament_auto_package()
3 changes: 2 additions & 1 deletion common/autoware_auto_geometry/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_auto_cmake</buildtool_depend>

<build_depend>autoware_cmake</build_depend>

<depend>autoware_auto_common</depend>
<depend>autoware_auto_geometry_msgs</depend>
Expand Down
12 changes: 3 additions & 9 deletions common/autoware_auto_perception_rviz_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.5)
project(autoware_auto_perception_rviz_plugin)

#dependencies
find_package(ament_cmake_auto REQUIRED)
find_package(autoware_cmake REQUIRED)
autoware_package()

find_package(Qt5 REQUIRED COMPONENTS Widgets)
ament_auto_find_build_dependencies()

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

if(BUILD_TESTING)
# run linters
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_auto_package(
INSTALL_TO_SHARE
icons
Expand Down
1 change: 1 addition & 0 deletions common/autoware_auto_perception_rviz_plugin/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<build_depend>autoware_cmake</build_depend>
<build_depend>qtbase5-dev</build_depend>

<depend>autoware_auto_perception_msgs</depend>
Expand Down
Loading

0 comments on commit 1dc920a

Please sign in to comment.