From 86c8569d824a770d818940231c505f68b0e83d25 Mon Sep 17 00:00:00 2001 From: Michael Spieler Date: Wed, 30 Apr 2025 11:42:51 -0700 Subject: [PATCH] Fix eigen plugins compile definition --- grid_map_core/CMakeLists.txt | 13 +++++++------ grid_map_core/cmake/grid_map_core-extras.cmake | 17 ----------------- 2 files changed, 7 insertions(+), 23 deletions(-) delete mode 100644 grid_map_core/cmake/grid_map_core-extras.cmake diff --git a/grid_map_core/CMakeLists.txt b/grid_map_core/CMakeLists.txt index cbf8ff5da..297c9b004 100644 --- a/grid_map_core/CMakeLists.txt +++ b/grid_map_core/CMakeLists.txt @@ -5,9 +5,6 @@ project(grid_map_core) find_package(ament_cmake REQUIRED) find_package(grid_map_cmake_helpers REQUIRED) -## Define Eigen addons. -include(cmake/${PROJECT_NAME}-extras.cmake) - ## System dependencies are found with CMake's conventions find_package(Eigen3 REQUIRED) @@ -44,6 +41,12 @@ target_include_directories(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen) +target_compile_definitions(${PROJECT_NAME} + PUBLIC + EIGEN_DENSEBASE_PLUGIN="grid_map_core/eigen_plugins/DenseBasePlugin.hpp" + EIGEN_FUNCTORS_PLUGIN="grid_map_core/eigen_plugins/FunctorsPlugin.hpp" +) + ############# ## Install ## ############# @@ -127,6 +130,4 @@ endif() ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET) ament_export_dependencies(Eigen3) -ament_package(CONFIG_EXTRAS - cmake/${PROJECT_NAME}-extras.cmake -) +ament_package() diff --git a/grid_map_core/cmake/grid_map_core-extras.cmake b/grid_map_core/cmake/grid_map_core-extras.cmake deleted file mode 100644 index dd4089d4e..000000000 --- a/grid_map_core/cmake/grid_map_core-extras.cmake +++ /dev/null @@ -1,17 +0,0 @@ -set(EIGEN_FUNCTORS_PLUGIN_PATH "grid_map_core/eigen_plugins/FunctorsPlugin.hpp") -if(EIGEN_FUNCTORS_PLUGIN) - if(NOT EIGEN_FUNCTORS_PLUGIN STREQUAL EIGEN_FUNCTORS_PLUGIN_PATH) - message(FATAL_ERROR "EIGEN_FUNCTORS_PLUGIN already defined") - endif() -else() - add_definitions(-DEIGEN_FUNCTORS_PLUGIN=\"${EIGEN_FUNCTORS_PLUGIN_PATH}\") -endif() - -set(EIGEN_DENSEBASE_PLUGIN_PATH "grid_map_core/eigen_plugins/DenseBasePlugin.hpp") -if(EIGEN_DENSEBASE_PLUGIN) - if(NOT EIGEN_DENSEBASE_PLUGIN STREQUAL EIGEN_DENSEBASE_PLUGIN_PATH) - message(FATAL_ERROR "EIGEN_DENSEBASE_PLUGIN already defined!") - endif() -else() - add_definitions(-DEIGEN_DENSEBASE_PLUGIN=\"${EIGEN_DENSEBASE_PLUGIN_PATH}\") -endif() \ No newline at end of file