cmake_minimum_required(VERSION 3.8)
project(create_robot_describer)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()
add_compile_options(-g)

#set(CMAKE_BUILD_TYPE Release)
set(CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE TRUE)
set(CGAL_DATA_DIR ".")

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(gjk_interface REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(CGAL REQUIRED)
find_package(moveit_ros_planning_interface REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)

include_directories(
  include
  ${CMAKE_CURRENT_SOURCE_DIR}/../include
  ${EIGEN3_INCLUDE_DIRS}  # 引入Eigen3的头文件路径
)

# 设置源文件
set(SOURCES
    src/create_robot_describe.cpp
)

# 添加可执行文件
add_executable(create_robot_describer ${SOURCES})

ament_target_dependencies(create_robot_describer 
  gjk_interface
  moveit_ros_planning_interface
)

target_link_libraries(create_robot_describer CGAL::CGAL)

install(TARGETS
  create_robot_describer
  DESTINATION lib/${PROJECT_NAME})

ament_package()
