From f128add1afeb2fa078230f37fdc282670c5f4ed1 Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Mon, 27 Jan 2025 13:23:19 +0100 Subject: [PATCH 1/2] fix: add support for Boost >= 1.76 Signed-off-by: Esteve Fernandez --- autoware_utils/CMakeLists.txt | 4 ++++ autoware_utils/src/geometry/random_concave_polygon.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/autoware_utils/CMakeLists.txt b/autoware_utils/CMakeLists.txt index 26ce297..9f03661 100644 --- a/autoware_utils/CMakeLists.txt +++ b/autoware_utils/CMakeLists.txt @@ -4,6 +4,10 @@ project(autoware_utils) find_package(autoware_cmake REQUIRED) autoware_package() +find_package(Boost REQUIRED) +target_compile_definitions(autoware_utils + PRIVATE BOOST_MAJOR_VERSION=${Boost_MAJOR_VERSION} BOOST_MINOR_VERSION=${Boost_MINOR_VERSION}) + file(GLOB_RECURSE src_files src/*.cpp src/geometry/*.cpp diff --git a/autoware_utils/src/geometry/random_concave_polygon.cpp b/autoware_utils/src/geometry/random_concave_polygon.cpp index b40e421..f491cd9 100644 --- a/autoware_utils/src/geometry/random_concave_polygon.cpp +++ b/autoware_utils/src/geometry/random_concave_polygon.cpp @@ -20,7 +20,12 @@ #include #include #include + +#if BOOST_MAJOR_VERSION == 1 && BOOST_MINOR_VERSION < 76 #include +#else +#error TODO: add support for Boost 1.76 or later (Ubuntu 24.04, ROS Jazzy) +#endif #include #include From a912c7d811f8e8937adc6dc2b0848e894980f458 Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Mon, 27 Jan 2025 16:22:44 +0100 Subject: [PATCH 2/2] fix CMake file Signed-off-by: Esteve Fernandez --- autoware_utils/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoware_utils/CMakeLists.txt b/autoware_utils/CMakeLists.txt index 9f03661..633e083 100644 --- a/autoware_utils/CMakeLists.txt +++ b/autoware_utils/CMakeLists.txt @@ -5,8 +5,6 @@ find_package(autoware_cmake REQUIRED) autoware_package() find_package(Boost REQUIRED) -target_compile_definitions(autoware_utils - PRIVATE BOOST_MAJOR_VERSION=${Boost_MAJOR_VERSION} BOOST_MINOR_VERSION=${Boost_MINOR_VERSION}) file(GLOB_RECURSE src_files src/*.cpp @@ -19,6 +17,8 @@ file(GLOB_RECURSE src_files ament_auto_add_library(autoware_utils SHARED ${src_files} ) +target_compile_definitions(autoware_utils + PRIVATE BOOST_MAJOR_VERSION=${Boost_MAJOR_VERSION} BOOST_MINOR_VERSION=${Boost_MINOR_VERSION}) if(BUILD_TESTING) file(GLOB_RECURSE test_files test/**/*.cpp)