Skip to content

Commit

Permalink
Fix CMakeLists for fuse_core, and fix fuse_echo
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed Oct 14, 2022
1 parent 095dfa1 commit aa287f0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
2 changes: 2 additions & 0 deletions fuse_constraints/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.0.2)
project(fuse_constraints)

# TODO(CH3): Migrate these to ament
set(build_depends
fuse_core
fuse_graphs
Expand All @@ -17,6 +18,7 @@ find_package(catkin REQUIRED COMPONENTS
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
find_package(Ceres REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(glog REQUIRED)
find_package(SuiteSparse REQUIRED COMPONENTS CCOLAMD)

catkin_package(
Expand Down
25 changes: 19 additions & 6 deletions fuse_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ find_package(rclcpp_components REQUIRED)

find_package(Ceres REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(glog REQUIRED) # Used downstream

include(boost-extras.cmake)

Expand Down Expand Up @@ -63,9 +62,14 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
)

## fuse_echo executable
add_executable(fuse_echo src/fuse_echo.cpp)
target_link_libraries(fuse_echo PUBLIC ${PROJECT_NAME})
target_link_libraries(fuse_echo PRIVATE rclcpp_components::component)
add_library(fuse_echo_component SHARED src/fuse_echo.cpp)
target_link_libraries(fuse_echo_component PUBLIC ${PROJECT_NAME})
target_link_libraries(fuse_echo_component PRIVATE rclcpp_components::component)

rclcpp_components_register_node(fuse_echo_component
PLUGIN "fuse_core::FuseEcho"
EXECUTABLE fuse_echo_node
EXECUTOR SingleThreadedExecutor)

#############
## Testing ##
Expand Down Expand Up @@ -486,7 +490,7 @@ install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-export
)

install(
TARGETS fuse_echo
TARGETS fuse_echo_component
DESTINATION lib/${PROJECT_NAME}
)

Expand All @@ -495,6 +499,15 @@ install(DIRECTORY include/
)

ament_export_targets(${PROJECT_NAME}-export HAS_LIBRARY_TARGET)
ament_export_dependencies(${ament_dependencies})
ament_export_dependencies(
ament_cmake
fuse_msgs
pluginlib
rcl_interfaces
rclcpp
rclcpp_components
Ceres
Eigen3
)

ament_package(CONFIG_EXTRAS boost-extras.cmake)
8 changes: 0 additions & 8 deletions fuse_core/src/fuse_echo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,6 @@ class FuseEcho : public rclcpp::Node

} // namespace fuse_core

int main(int argc, char **argv)
{
rclcpp::init(argc, argv);
rclcpp::NodeOptions options;
rclcpp::spin(std::make_shared<fuse_core::FuseEcho>(options));
rclcpp::shutdown();
return 0;
}

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(fuse_core::FuseEcho)

0 comments on commit aa287f0

Please sign in to comment.