simple_slam/CMakeLists.txt
2024-05-26 16:26:59 +02:00

58 lines
1.7 KiB
CMake

cmake_minimum_required(VERSION 3.8)
project(simple_slam)
set(CMAKE_CXX_STANDARD 23)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(tf2_sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)# uncomment the following section in order to fill in
find_package(nav_msgs REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(Ceres REQUIRED)
# further dependencies manually.
# find_package(<dependency> REQUIRED)
find_package(Eigen3 REQUIRED NO_MODULE)
add_executable(simpleslam src/simpleslam_node.cpp )
ament_target_dependencies(simpleslam rclcpp sensor_msgs nav_msgs)
target_link_libraries(simpleslam Ceres::ceres Eigen3::Eigen)
# include_directories(include lib/karto_sdk/include
# ${EIGEN3_INCLUDE_DIRS}
# ${CERES_INCLUDES}
# )
install(TARGETS
simpleslam
DESTINATION lib/${PROJECT_NAME})
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()