Gazebo | Ignition | Community
Ask Your Question
0

Unknown CMake command "ign_find_package".

asked 2022-05-19 04:02:15 -0600

florian.pix gravatar image

I get the same error as in this post but I couldn't solve it by just sourcing my ignition workspace.

I installed ignition gazebo edifice with these instructions. The place where I build it with colcon build --merge-install is ~/workspace.

Now I tried to recreate the example plugin in another folder ~/ros2_ws/src/plugins/sample_system.

Then I source the ign workspace with . ~/workspace/install/setup.bash and try to build the ros2_ws with colcon build but I get this error

CMake Error at CMakeLists.txt:5 (ign_find_package):
  Unknown CMake command "ign_find_package".
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-05-24 07:56:26 -0600

florian.pix gravatar image

The system plugin tutorial from ign gazebo seems to be incomplete. Before using "ign_find_package" you need to first put in "find_package(ignition-cmake2 REQUIRED)". Also ign_find_package isn*t needed in every case. For example a basic GUI Plugins CMakeLists.txt could look like this:

cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)

if(POLICY CMP0100)
  cmake_policy(SET CMP0100 NEW)
endif()

project(test_plugin)

set(CMAKE_AUTOMOC ON)

find_package(ignition-gazebo5 REQUIRED COMPONENTS gui)

QT5_ADD_RESOURCES(resources_RCC ${PROJECT_NAME}.qrc)

add_library(${PROJECT_NAME} SHARED
  ${PROJECT_NAME}.cc
  ${resources_RCC}
)
target_link_libraries(${PROJECT_NAME}
    PRIVATE ignition-gazebo5::gui
)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-05-19 04:02:15 -0600

Seen: 111 times

Last updated: May 24 '22