diff --git a/ros_ign_dev/ign_gazebo_dev/CMakeLists.txt b/ros_ign_dev/ign_gazebo_dev/CMakeLists.txt new file mode 100644 index 00000000..6344b31a --- /dev/null +++ b/ros_ign_dev/ign_gazebo_dev/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.5) +find_package(ament_cmake REQUIRED) +project(ign_gazebo_dev) + +ament_package( +CONFIG_EXTRAS cmake/ignition_gazebo_dev-extras.cmake) diff --git a/ros_ign_dev/ign_gazebo_dev/cmake/ignition_gazebo_dev-extras.cmake b/ros_ign_dev/ign_gazebo_dev/cmake/ignition_gazebo_dev-extras.cmake new file mode 100644 index 00000000..12415183 --- /dev/null +++ b/ros_ign_dev/ign_gazebo_dev/cmake/ignition_gazebo_dev-extras.cmake @@ -0,0 +1,24 @@ +# This code here calls and sets required igniton gazebo based on ROS Distribution so,packages can directly go find_package(ign_gazebo_dev) so,that +# they don't need to change code with different ros distros +set( ENV{OVERRIDE_ROS_GZ_VERSION} 6 ) + +if(DEFINED ENV{ROS_DISTRO}) +message(STATUS "Detected ROS Distro is $ENV{ROS_DISTRO}") +endif() + +if("$ENV{ROS_DISTRO}" MATCHES "foxy") + find_package(ignition-gazebo3 REQUIRED) + set(IGN_GAZEBO_VER ${ignition-gazebo3_VERSION_MAJOR}) +elseif("$ENV{ROS_DISTRO}" MATCHES "galactic") + find_package(ignition-gazebo5 REQUIRED) + set(IGN_GAZEBO_VER ${ignition-gazebo5_VERSION_MAJOR}) +elseif("$ENV{ROS_DISTRO}" MATCHES "humble") + find_package(ignition-gazebo6 REQUIRED) + set(IGN_GAZEBO_VER ${ignition-gazebo6_VERSION_MAJOR}) +else() + message(STATUS "No ROS Distro detected") + message(STATUS "Setting to default gazebo version") + find_package(ignition-gazebo$ENV{OVERRIDE_ROS_GZ_VERSION} REQUIRED) + set(IGN_GAZEBO_VER ${ignition-gazebo$ENV{OVERRIDE_ROS_GZ_VERSION}_VERSION_MAJOR}) + +endif() diff --git a/ros_ign_dev/ign_gazebo_dev/package.xml b/ros_ign_dev/ign_gazebo_dev/package.xml new file mode 100644 index 00000000..86a6dca7 --- /dev/null +++ b/ros_ign_dev/ign_gazebo_dev/package.xml @@ -0,0 +1,32 @@ + + + ign_gazebo_dev + 1.0.0 + Package to pull default ignition gazebo version for each ROS distro + + Harsh Mahesheka + + Apache License 2.0 + + Harsh Mahesheka + + ros_environment + ament_cmake + ignition-gazebo3 + ignition-gazebo5 + ignition-gazebo6 + + + + ignition-gazebo6 + + + + + + + + ament_cmake + +